Patch by Matt Lundin
Matt writes:
> The missing piece of the puzzle is integration with "diary" and
> "cal-tex" functions via the org-diary sexp. I have found org-diary to be
> excruciatingly slow when called for anything more than a couple of days.
> I have the following line in my diary file:
>
> &%%(org-diary :timestamp :sexp)
>
> If I try to view 20 or so upcoming days in the diary by typing C-u 20 d
> on a date in the calendar, it can take upwards of 30 seconds to generate
> the diary display. This is of little consequence, since I can, after
> all, simply use the custom agenda command. But I often want to print out
> a nice LaTeX calendar of my appointments with cal-tex-cursor-month. And
> that takes upwards of 50 seconds (see attached elp-results file).
>
> Judging from the elp-results, the culprit seems to be
> org-prepare-agenda-buffers (46 seconds), which is called 31 times (once
> for each day). It seems to me that since org-diary is being called 31
> times in quick succession by the same function (diary-sexp-entry), one
> should only need to call org-prepare-agenda-buffers once.
>
> The only solution I could see to this problem was to add a test to see
> if org-diary had been called less than 1 second ago. Thus, I added the
> variable org-diary-last-run-time and a conditional in org-diary that
> only runs org-prepare-agenda-buffers if org-diary-last-run-time is less
> than 1 second in the past.
>
> With the patch, it now takes appr. 5 seconds to generate the LaTeX
> calendar with cal-tex and org-prepare-agenda-buffers is called only
> once.
Allow C-2 C-c C-w to work in the agenda.
Update agenda after refiling
This rebuilds the agenda buffer after the refile operation completes.
It was removing the to-be-refiled task before prompting for the location
which felt a little strange. While on the prompt you can't see
the task you are refiling anymore since it was just removed from the
agenda list and if you aborted from the refile operation
with C-g then the task to be refiled has already been removed.
org-agenda.el (org-agenda-include-deadlines): Added new
customization variable to determine whether unscheduled tasks
should appear in the agenda solely because of their deadline.
Default to true, which was the previous behavior (it just wasn't
configurable).
(org-agenda-mode-map, org-agenda-view-mode-dispatch): Bind ! in
the agenda to show/hide deadline tasks.
(org-agenda-menu): Added menu option for show/hide deadlines.
(org-agenda-list): Make the agenda list sensitive to the value of
`org-agenda-include-deadlines'.
(org-agenda-toggle-deadlines): New function to toggle the value of
`org-agenda-include-deadlines' and repaint the modeline
indicators.
(org-agenda-set-mode-name): Show "Deadlines" in the agenda
modeline if deadline tasks are being displayed.
Patch by Matt Lundin
Matt writes:
> Below is a patch I've been using to speed up the construction of
> agenda views limited to certain types of entries (e.g., timestamps and
> sexps). Previously, I had constructed "calendar" views consisting
> only of timestamps and sexps by using the variable
> org-agenda-skip-function to exclude scheduled items and deadlines from
> the agenda. This, however, proved somewhat slow (3-4 seconds for
> weekly calendars, 10-12 seconds for monthly calendars). The patch
> below cuts the times to 1 and 3 seconds respectively. I believe it
> provides an efficient alternative to the skip function by allowing the
> user to tweak the arguments passed to org-agenda-get-day-entries.
Patch by Stephen Eglen, who writes:
> Just a small suggestion here. In the agenda, an entry like:
> * <2010-01-20 Wed 09:00-09:30> test
>
> gets formatted as follows:
>
> Wednesday 20 January 2010
> 8:00...... ----------------
> test: 9:00- 9:30 test
> 10:00...... ----------------
>
> the leading whitespace before '9:00' and '9:30' is needed to align the
> times, but having the space after the dash looks odd (at least to my
> latex-trained eyes). Would it be possible to patch org-agenda to put a
> leading zero rather than leading whitespace. With this patch, I see:
>
> Wednesday 20 January 2010
> 08:00...... ----------------
> test: 09:00-09:30 test
> 10:00...... ----------------
This patch introduces a new user option to select this behavior.
Stephen Eglen writes
> Within the agenda buffer, if I type 'i j' to jump to the current date I
> get:
>
> Debugger entered--Lisp error: (void-function org-datetree-find-date-create)
> org-datetree-find-date-create((1 20 2010))
> org-agenda-diary-entry-in-org-file()
> org-agenda-diary-entry()
> call-interactively(org-agenda-diary-entry nil nil)
>
> If I then do M-x load-library org-datetree
>
> and repeat 'i j', it works. Should this function be autoloaded?
Patch by Stephan Schmitt, who writes:
> An error was thrown when all tags of a headline are hidden by
> org-agenda-hide-tags-regexp (in this case the function
> get-text-property got nil as third argument)
Samuel Wales writes:
> I found three places where the lowercase version of a todo
> kw is treated specially in the latest org. For example,
>
> * todo this is lowercase
>
> First, in the agenda, they have a special face.
>
> Second, when inserting an id link, they are removed.
>
> Third, when printing the olpath, they are removed. To
> reproduce, place point at bol on 5 and press the spacebar.
> I expect todo to be in the olpath, but it is not.
>
> Thanks.
>
>
> Samuel
>
>
> * 1
> *** 2
> ***** here are some keywords i like
> ******* todo
> ********* 5
When an agenda custom command has an empty string as MATCH element, so
far this would lead to a meaningless search using an empty matcher.
Now and empty (or white) string will be interpreted just like a nil
matcher, i.e. the user will be prompted for the match.
Lukas Stelmach writes:
> Isn't it wrong when a note like this:
>
> * A very interesting meeting 11:15-12:00
> <2009-11-30 Mon>--<2009-12-01 Tue>
>
> Shows up in the agenda time gird only on monday while being untimed on
> tuesday? To make it right I do
>
> * A very interesting meeting
> <2009-11-30 Mon 11:15>--<2009-11-30 Mon 12:00>
> <2009-12-01 Tue 11:15>--<2009-12-01 Tue 12:00>
>
> or simply
>
> * A very interesting meeting 11:15-12:00
> <2009-11-30 Mon>
> <2009-12-01 Tue>
>
> Which works but doesn't show the recurrence counter.
Bernt Hansen writes:
> When org-agenda-diary-file is set to a special org file for diary
> entries and transient mark mode is enabled 'i' in the agenda fails
> with 'mark is not active now'
>
> My workaround for this is C-SPC to set the mark anywhere legal in the
> agenda display (ie not on the first or last line) and then hit 'i'
> to insert my diary entries.
Matt Lundin writes:
> The new org-agenda-diary-entry looks quite convenient.
>
> Would it be possible to add an option to bypass the date tree so as to
> add each new appointment as a simple first level heading? I prefer to
> keep my appointments organized by project and/or category and have no
> real use for the date tree. Ideally, new appointments would appear as
> first level headlines in the org-agenda-diary-file (i.e., my inbox),
> ready to be refiled.
RET will only do this if the cursor is on the link and
`org-return-follows-link' is set. `C-c C-o' will work anywhere in the
line.
Requested by Chris Leyon.
The following keys now do archiving
C-c C-x C-a archive using the command specified in
`org-archive-default-command'
This variable is by default set to `org-archive-subtree', which means
arching to the archive file.
The three specific archiving commands are available through
C-c C-x C-s archive to archive file
C-c C-x a toggle the archive tag
C-c C-x A move to archive sibling
These bindings work the same in an Org file, and in the agenda.
In addition:
- In the agenda you can also use `a' to call the default archiving
command, but you need to confirm the command with `y' so that this
cannot easily happen by accident.
- For backward compatibility, `C-c $' in an org-mode file, and `$' in
the agenda buffer continue to archive to archive file.
Richard Moreland writes:
> (setq org-agenda-custom-commands
> '(("X" agenda "" nil ("agenda.html"))))
> ;; This seems to break org-mobile-push?
> ;;(setq org-agenda-exporter-settings
> ;; '((org-agenda-add-entry-text-maxlines 5)
> ;; (htmlize-output-type 'font)))
>
> I have the lines above in my .emacs file. When I uncomment the 3
> commented lines, org-mobile-push just hangs after OVERVIEW.
>
> I don't understand exactly what is going on, but if I hit C-g or
> C-c enough I can regain control, but the sync never finishes.
org-habit.el (org-habit-get-priority): A new function that determines
the relative priority of a habit, based on how long past its scheduled
date it is, and how near the deadline is.
org-agenda.el (org-agenda-get-scheduled): Set habit priority using
`org-habit-get-priority'.
org-habit.el: New file, which implements code to build a "habit
consistency graph".
org-agenda.el (org-agenda-get-deadlines)
(org-agenda-get-scheduled): Display consistency graphs when outputting
habits into the agenda. The graphs are always relative to the current
time.
(org-format-agenda-item): Added new parameter `habitp', which indicates
whether we are formatting a habit or not. Do not display "extra"
leading information if habitp is true.
(org-agenda-auto-exclude-function): New customization variable for
allowing the user to create an "auto exclusion" filter for doing
context-aware auto tag filtering.
(org-agenda-filter-by-tag): Changes to support the use of
`org-agenda-auto-exclude-function'. See the new manual addition,.
The default in search view is not that the search expression is
searched for as a substring, i.e. the different words must occur in
direct sequence. The old way is only used it the first word in
the search string is preceded by a plus or a minus.
This was, more-or-less, requested by John Wiegley.
Peter Westlake writes:
> One small thing, though - in the agenda TODO view, pressing "t"
> to mark the task as Done messes up the layout:
>
> [[http://orgmode.org][Org-Mode]]: TODO Demonstrate problem with link
> in category
>
> (which appears as:
>
> Org-Mode: TODO Demonstrate problem with link in category)
>
>
> Press T on that line:
>
> [[http://orgmode.org][Org-Mode]]: TODO Demonstrate problemDONE
> Demonstrate problem with link in category
>
> (which appears as:
>
> Org-Mode: TODO Demonstrate problemDONE Demonstrate problem with
> link in category)
George Pearson writes:
> I have been getting the following message in the minibuffer
> area when marking tasks done in the daily agenda:
>
> Error in post-command-hook: (error Cannot switch buffers in a dedicated
> window)
>
> The item in the underlying org file IS marked DONE, and items with
> repeaters appear to be rescheduled properly. HOWEVER, the log lines,
> like
>
> - State "DONE" from "TODO" [2009-09-07 Mon 10:36]
>
> do NOT appear.
>
> Note I have been using:
>
> org-agenda-window-setup 'other-frame
>
> for some time now, but I notice there has been a recent change
> related to this variable. Could this be the source of the
> problem?
>
> I believe the error message appears on other operations in the
> daily agenda as well, but have not yet studied this in detail.
Many agenda commands split the current window, which is not allowed on
a frame containing a dedicated window.
Therefore, we now just kill the frame by hand when exiting the agenda.
org.el (org-offer-links-in-entry): Don't use "Select link" as a prompt
in the temporary window.
org-agenda.el (org-agenda-bulk-mark): Use a slightly soberer prefix for
marked entries in the agenda view.
> > New mode to show some entry body text in the agenda
> > ----------------------------------------------------
> > There is now a new agenda sub-mode called
> > `org-agenda-entry-text-mode'. It is toggled with the `E' key.
> > When active, all entries in the agenda will be accompanied by a
> > few lines from the outline entry. The amount of text can be
> > customized with the variable `org-agenda-entry-text-maxlines'.
>
>
> this already avoids displaying drawer lines.
> I also see lines like:
>
> - State "DONE" from "WARTEN" [2009-08-04 Di 16:19]
> - State "DONE" from "WARTEN" [2009-07-02 Do 09:43]
> ...
>
> and in my remeber templates I always create lines like:
>
> created: [2009-08-03 Mo 11:46]
>
> with the creation date of the entry.
> Would it be possible and make sense to set up a variable for a
> regexp to exclude lines like the ones above from showing?
This commit sets up such a variable, and also a hook.
The category can contain a bracket link. This commit makes sure that
the prefix in the agenda looks OK if there is a link, and that the
link is accessible with `C-c C-o 0'.
Peter Westlake writes:
> This is quite obscure, and an odd corner case, but here it is.
>
> If you have an item which is:
>
> - a TODO
> - scheduled
> - ordered
> - blocked by a child TODO
>
> then it leaves an empty line in the agenda.
>
> Here's a test case:
> ,----
> | * Press t r on this line in the agenda
> | SCHEDULED: <2009-09-02 Wed>
> | :PROPERTIES:
> | :ORDERED: t
> | :END:
> | *** TODO Report invisible scheduled items
> `----
>
> C-a a a will show an agenda with "Scheduled: Press t r ...".
> Press "t" on that line to add a TODO.
> Press "r" to redisplay, and see the line go blank.
>
> Peter.
Henry Atting writes:
> If org agenda is displayed in an other frame then windows aren*t
> restored when quitting, I have to kill the frame manually. I
> really would like it to behave like e.g. gnus-other-frame which
> automatically kills his frame on quitting.
The new keys are b and f. This used to be on the cursor keys, but
they do now again do cursor motion.
This is a significant change in the UI, I hope this will not cause too
many problems.
Fix bulk refiling in the agenda due to commit
9ec5529 (Fix jumping to last refile location in agenda, 2009-08-20)
This restores the original behaviour.
This bug was caused by commit
8c177dc832, and reported by Matt
Lundin. The problem was that this commit tried to remove the text
propertes of the MATCH part of an agenda command. However, in block
commands, the MATCH part is not a string.
New variable `org-agenda-skip-scheduled-if-deadline-is-shown' to avoid
that a entry shows up in the agenda for today for both a scheduling
and a deadline entry. See the docstring of the variables for more
details.
Bernt Hansen writes:
> Every so often I run into a situation where bulk refiling
> doesn't work anymore.
>
> I currently have 15 items in my refile.org file that I want
> to refile to other locations. I marked a few of them and
> bulk refiled them just fine. Then I marked a few more and B
> r fails with "Cannot find entry for marker #<marker at
> 297156 in norang.org>"
>
> I think this happens when I mark multiple tasks in the same
> subtree (i.e. the parent and a sibling) and refile both to
> the same location. After that it gets confused.
>
> If I have a task like this in refile.org
>
> #+FILETAGS: REFILE
> * Test
> ** Test 2
>
> and run a tags match on REFILE I see both tasks. Mark both
> with m in the agenda and B r to some other location. It
> refiles the first (and this moves the sibling too) and then
> it's broken after that.
>
> I get the following backtrace
>
> Debugger entered--Lisp error: (error "Cannot find entry for
> marker #<marker at 297156 in norang.org>")
Indeed the happens because, when a parent gets refiled or
achieved, any entries corresponding to its children are
removed from the agenda.
We address this issue by
- sorting the markers, to make sure parents will be handled
before children
- No longer throwing an error when a bulk action entry no
longer is present in the agenda - most likely it was taken
care of together with its parent.
This commit defines three new functions in org-timer.el:
- org-timer-set-timer, bound to `C-c C-x ;' in Org buffers
and to `;' in Org agenda buffers. This function sets a
timer for the headline the cursor is currently it. Up to
three timers can be set.
- org-timer-show-remaining-time: this shows the remaining
time for the last set timer.
- org-timer-reset-timers: this reset all timers.
This functionality was requested by Samuel Wales and emulates
that of tea-time.el -- see the emacswiki doc about tea-time.el:
http://www.emacswiki.org/emacs/tea-time
Agenda bulk commands on marked entries now can also set the scheduling
date or a deadline. Normally, all entries will be set to the
specified date. However, when writing the change as "++5d" or "++2w",
then each time stamp will independently be shifted by that amount.
This commit implements refiling directly from the agenda.
It also implements a mechanism for selecting a number of entries in
the agenda and then executing a command on all of them. Possible
actions include archive, refile, todo state setting, and more.