emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] Extract prefix information from diary sexp entries for agend


From: Toby Cubitt
Subject: [O] [PATCH] Extract prefix information from diary sexp entries for agenda display
Date: Mon, 23 Apr 2012 00:28:38 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

This patch adds a new org-agenda-diary-sexp-prefix customization
option. It can be set to a regexp which is used to match the part of the
text produced by a diary sexp entry that should be treated as
deadlining/scheduling information (the "prefix"), and displayed as such
in agenda views.

For example, let's say diary-remind-message is set to

  '("In " (format "%3d d." days) ":  " diary-entry)

to match the default format used for upcoming deadlines in org-mode. Then
the following diary-remind entry

  %%(diary-remind '(diary-date t 4 30) -14) Don't forget this birthday

will produce a line something like this:

  In  7 d.: Don't forget this birthday

in agenda views. But the "In 7 d.:" part will be displayed as part of the
entry, *not* in the "prefix" column where org-mode displays deadline and
scheduling information for normal org items, which looks like this:

  In  2 d.:   TODO Important thing to do soon
              In  7 d.: Don't forget this birthday
  Deadline:   TODO Do this today or else!

Setting org-agenda-diary-sexp-prefix to the regexp

  "^In +[0-9]+ d\\.:"

will extract the "In x days:" part of a diary sexp entry, and display it
as the prefix (i.e. deadline/scheduling info) for the entry in agenda
views, aligning it with the prefixes from org-mode's own deadline
entries:

  In  2 d.:   TODO Important thing to do soon
  In  7 d.:   Don't forget this birthday
  Deadline:   TODO Do this today or else!


More generally, org-mode has access to a lot of structured information
about its own agenda entries. But a diary sexp entry hands org-mode a
lump of output text, with no structure to tell it what information is
represented by different parts of that
text. `org-agenda-diary-sexp-prefix' gives you a way of telling org-mode
how to extract scheduling and deadline information from that lump of
text.

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: address@hidden
web:   www.dr-qubit.org

Attachment: 0001-Agenda-Add-org-agenda-diary-sexp-prefix-customizatio.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]