* org-agenda.el (org-get-entries-from-diary): Put multiline
diary entries on a single line when lines don't start with a
diary time.
This was requested by Suvayu Ali.
Locally kill org-agenda-current-span as a variable, otherwise
the current value of org-agenda-current-span is taken as the
default value when redoing the buffer or calling org-agenda
with a different view.
This might be a temporary fix, as Julien is looking for a
more general solution. See his message here:
http://article.gmane.org/gmane.emacs.orgmode/37359
* lisp/org-agenda.el (org-agenda-filter-by-tag): Refresh agenda when
updating the filter while the clock report is following the filter.
When the clock table in the agenda has been set up to respect the
current agenda tags filter, modifying the filter will now
automatically rebuild the agenda to make sure that also the clock
report is updated along with it. Updating the entire agenda is not
strictly necessary - updating the table would be enough. However,
right now we do not really have a function that will update only the
clock table, as inserting the table is currently part of building the
agenda itself. Maybe someone can optimize this in the future.
This feature was requested by Sebastien Vauban.
On Sat, Feb 05 2011, Matt Lundin wrote:
> This results in only a day view because org-agenda-current-span is still
> 'day.
Here's a proposal fix.
I could have setq org-agenda-current-span to nil as a work around, but
it seems more logical to just kill all the local variables. That is, a
custom agenda view would not keep any of the local variable of the
previous agenda, which seems logical to me.
>From b48fc7c395dffea60df20c23b26e362ac0354b01 Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Mon, 7 Feb 2011 12:36:42 +0100
Subject: [PATCH] org-agenda: kill local variables in agenda view
* org-agenda.el (org-agenda): Kill all local variables. This
assures we are not keeping buffer variable from an old agenda view
when switching to a new custom agenda.
Signed-off-by: Julien Danjou <julien@danjou.info>
* lisp/org-agenda.el (org-agenda-get-day-entries): Compare DATE with
modified today.
When a user sets org-extend-today-until, the agenda TODO list would
come up empty when requested in the extension period between midnight
and org-extend-today-until. This problem is new, it was caused by a
patch that introduced the function org-today and used it also
in org-todo-list.
The reason why this caused a problem is a bit difficult. The agenda
need a date to be defined, and getting todo entries is subject to the
current date being today. This is a leftover condition from the times
when the TODO list was often part of the daily agenda listing, and the
test is there to avoid that the TODO list comes also up when looking
at the agenda for tomorrow. Much of this is irrelevant now, because
people use either block agendas, or separate views - but the old
functionality is retained for backward compatibility.
This patch fixes the problem by making `org-agenda-get-day-entries'
check for the date computed by `org-today'.
* org-agenda.el (org-agenda-bulk-mark-regexp): New command.
(org-agenda-menu): Add the new command to the menu.
(org-agenda-mode-map): Add % as the keybinding for the new
command.
* org-agenda.el (org-agenda-repeating-timestamp-show-all):
Allow to use a list of TODO keywords as the value of this
variable. The agenda will show repeating stamps for entries
matching these TODO keywords.
(org-agenda-get-timestamps, org-agenda-get-deadlines)
(org-agenda-get-scheduled): Allow the use of a list of
keywords in `org-agenda-repeating-timestamp-show-all'.
---
This was suggested by Jeff Horn and supported by Detlef Steuer.
On Mon, Jan 17 2011, Carsten Dominik wrote:
> have you been following this thread? I think this has to do with your
> rewrite of the dagenda span stuff. Maybe you can find out better and
> faster that I why this goes wrong? Please read the entire thread.
I've followed but not sure I understood what the bug is. But from my
various tries, I found a bug: when pressing 'j', the current span is
discarded.
Attached is a patch that should fix that, even for future use of
`org-agenda-list' with the span unspecified. :)
>From 9dd2fe6650b858a4083ebc083bb8d10a0d6ac7f2 Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Mon, 17 Jan 2011 16:05:28 +0100
Subject: [PATCH] Fix agenda span on date jump
* org-agenda.el (org-agenda-list): Use org-agenda-current-span as a
possible default span if it is set.
Signed-off-by: Julien Danjou <julien@danjou.info>
* org-agenda.el (org-agenda-get-progress): Fix regexp for statep: it
must has \\ at the end of the line. This avoid matching the following
heading when there's no newline between the logged state and the next
heading.
Signed-off-by: Julien Danjou <julien@danjou.info>
* lisp/org-agenda.el: (org-agenda-todo-ignore-deadlines): New option.
(org-agenda-todo-ignore-scheduled): New option.
(org-agenda-todo-ignore-timestamp): New option.
(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item): Allow user
to specify custom distance to ignore (future or past).
(org-agenda-todo-custom-ignore-p): New function.
This patch gives users greater control over which past or future items
they would like to ignore in the global todo list. By setting
org-agenda-todo-ignore-scheduled to 7, for instance, a user can ignore
all items scheduled 7 or more days in the future. Similarly, by
setting org-agenda-todo-ignore-scheduled to -1, a user can ignore all
items that are truly in the past (unlike the 'past setting, which
ignores items scheduled today). Thanks to Paul Sexton for the idea for
this new functionality.
* org-agenda.el (org-agenda-get-blocks): Fix time of start/end
of events with range. This display things like:
<2011-01-22 Sat 14:00>--<2011-01-23 Sun 20:00>
correctly, with the event starting at 14:00 and ending at 20:00.
Signed-off-by: Julien Danjou <julien@danjou.info>
On Mon, Jan 17 2011, Bernt Hansen wrote:
>
> Thanks for this patch. I think this fixes the issue I was having with
> 'j' in the agenda switching from week-view back to single-day view when
> org-agenda-ndays is set to 1.
>
> There is still a (new?) problem with jumping to today.
>
> Set the following variable
>
> (setq org-agenda-start-on-weekday 6)
>
> | Key Sequence | Notes |
> |--------------+------------------------------------------------|
> | C-c a a | Display weekly agenda |
> | f | Go forward a week |
> | d | Display day agenda |
> | . | Go to to day - but it goes to Saturday instead |
>
> This should go to today and not the first day of the week.
Attached is a fix for that.
>From f566a5612560f997f4760144ca850dda5c06bc5e Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Mon, 17 Jan 2011 18:09:30 +0100
Subject: [PATCH] Fix org-agenda-goto-today not respecting the current span.
* org-agenda.el (org-agenda-goto-today): Respect current span.
Signed-off-by: Julien Danjou <julien@danjou.info>
* lisp/org-agenda.el (org-agenda-skip-function-global): New option.
(org-agenda-skip-eval): New function.
(org-agenda-skip): Use `org-agenda-skip-eval' and also check for the
global skipping condition.
This was a request by John Wiegley
* lisp/org-agenda.el (org-agenda-goto): Display invisible entry text
* lisp/org-agenda.el (org-agenda-switch-to): Display invisible entry text
Visiting clock lines with RET or TAB in the agenda can put point on a
folded clock drawer. This means you are editing invisible/hidden text
inside the task entry. Now when moving to invisible regions show the
entry so point is always visible.
* lisp/org-agenda.el: (org-agenda-get-scheduled) Don't call
org-is-habit-p until after checking for for
org-agenda-skip-scheduled-if-done.
Org-agenda-get-scheduled was calling org-is-habit-p on every scheduled
item (including DONE items when org-agenda-skip-scheduled-if-done was
set to t). Tweaking the timing of the test shaves some time off of
agenda construction when org-habit is loaded and
org-agenda-skip-scheduled-if-done is t.
Before: org-is-habit-p 478 0.2434439999 0.0005092970
After: org-is-habit-p 81 0.057944 0.0007153580
* lisp/org-faces.el (org-agenda-current-time): New face.
* lisp/org-agenda.el (org-agenda-show-current-time-in-grid):
(org-agenda-current-time-string): New options.
(org-agenda-add-time-grid-maybe): Add current time to time grid.
suvayu ali <fatkasuvayu+linux@gmail.com> writes:
> I actually tried to set the text properties for the string instead,
> but looks like org-agenda is ignoring that.
>
> (defun jd:org-current-time ()
> "Return current-time if date is today."
> (when (equal date (calendar-current-date))
> (propertize (format-time-string "%H:%M Current time") 'font-lock-face
> '(:weight bold :foreground "DodgerBlue4" :background "snow"))))
To accomplish this you'd have to apply the following patch and use 'face
property rather than font-lock-face.
Why can't a sexp choose its 'face after all?
--8<---------------cut here---------------start------------->8---
--8<---------------cut here---------------end--------------->8---
B S will cause tasks to be rescheduled a random number of days into the
future, with 7 as the default. This is useful if you've got a ton of
tasks scheduled for today, you realize you'll never deal with them all,
and you just want them to be distributed across the next N days.
* org-agenda.el (org-agenda-custom-commands-local-options):
Allow org-agenda-span to be a symbol.
(org-agenda-ndays): Make obsolete.
(org-agenda-span): New variable superseding org-agenda-ndays.
(org-agenda-menu): Use org-agenda-current-span.
(org-agenda-current-span): New local variable storing current
span.
(org-agenda-list): Take a span instead of ndays as argument.
This function is now responsible for computing the ndays based
on span.
(org-agenda-ndays-to-span): Return span only if number of days
really matches.
(org-agenda-span-to-ndays): New function.
(org-agenda-manipulate-query): Use org-agenda-compute-starting-span.
(org-agenda-goto-today): Use org-agenda-compute-starting-span.
(org-agenda-later): Do not give compute a new span, use the
current one.
(org-agenda-day-view, org-agenda-week-view)
(org-agenda-month-view, org-agenda-year-view): Stop touching
org-agenda-ndays.
(org-agenda-change-time-span): Only compute starting-span.
(org-agenda-compute-starting-span): New function derived from
the old org-agenda-compute-time-span.
(org-agenda-set-mode-name): Compute mode based on
org-agenda-current-span.
(org-agenda-span-name): New function.
* org-mouse.el: Replace Replace org-agenda-ndays by
org-agenda-current-span.
* org.texi, orgguide.texi: Replace org-agenda-ndays by
org-agenda-span. Add a paragraph about org-agenda-span and say that
org-agenda-ndays is now deprecated.
This patch is pretty huge, so I'll give a bit of context about it.
I'm weird, but I used org-agenda-ndays set to 14. Unfortunately, this
settings was interpreted as a month view. Pressing 'f' key to see later,
would show me the next month, which was not at all what I wanted.
On the same idea, day view or week view would change my org-agenda-ndays
settings, which I think is not a good idea. Changing user setting is *bad*.
:-)
So I rewrote the things this way:
- Rename org-agenda-span to org-agenda-current-span
Which has the same meaning has before, except it can be numeric.
- Rename org-agenda-ndays to org-agenda-span
I think the name is better choosen. You can set it to a symbol instead of
only a numeric value. That means you can set it to 'month and it will show
you the number of days of the current month in your agenda. Better than
30. But you can still set it to 30, or 31, or whatever you want.
- Do not change org-agenda-span. Never.
- Use org-agenda-current-span for navigation.
That means if you press 'f', it will shows you really the next
org-agenda-current-span ndays, and not something based on "I think you
want a weekly view".
* lisp/org-agenda.el: (org-format-agenda-item) The value of
org-category is not converted to a string unless it is defined.
This fixes commit 3061c7083d, which
resulted in org-format-agenda-item always returning the symbol-name for
org-category even if it was not defined. I.e., in some instances,
org-format-agenda-item returned the string "nil", thus bypassing the
buffer-file-name method of deriving the category.
* org-agenda.el (org-format-agenda-item): Convert category to a string
if it is a symbol. This fixes the following call to
org-agenda-get-category-icon which fails if category is not a string.
Signed-off-by: Julien Danjou <julien@danjou.info>