emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: Org Mode <emacs-orgmode@gnu.org>
Cc: Matt Lundin <mdl@imapmail.org>
Subject: Re: Displaying deadline datestamp in todo agenda list?
Date: Wed, 25 May 2016 18:23:00 -0500	[thread overview]
Message-ID: <87mvndsox7.fsf@red-bean.com> (raw)
In-Reply-To: <87h9dmrnqv.fsf@fastmail.fm> (Matt Lundin's message of "Wed, 25 May 2016 13:33:44 -0500")

Matt Lundin <mdl@imapmail.org> writes:
>Here's a working implementation, using org-agenda-add-custom-command and
>the built-in mechanism for skipping non-deadline entries (you can get
>rid of ots-org-entry-skip-non-deadline). I also added some justification
>(the -22) to accommodate my rather long timestamp strings. Adjust as
>needed:
>
>(org-add-agenda-custom-command
> '("d" "Deadlines and scheduled work" alltodo ""
>   ((org-agenda-skip-function '(org-agenda-skip-entry-if 'notdeadline))
>    (org-agenda-prefix-format '((todo . " %i %-22(org-entry-get nil \"DEADLINE\") %-12:c %s")))
>    (org-agenda-sorting-strategy '(deadline-up)))))
>
>Matt

Matt, I can't thank you enough -- this is great.  (Our company runs on Org Mode, so this will help more free software hackers than just me :-) .)

The core trick is obviously "(org-entry-get nil \"DEADLINE\")".  I knew about embedding a Lisp expression into the format string, but didn't know about that particular function -- now that I know it exists, I suspect we'll be using it a lot.  And the "(org-agenda-skip-entry-if 'notdeadline)" part saves us a bunch of custom code too.

This is the best kind of solution: it solved the immediate problem and gives us infrastructure for solving future problems as well.

Thanks!

-Karl

      reply	other threads:[~2016-05-25 23:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 17:06 Displaying deadline datestamp in todo agenda list? Karl Fogel
2016-05-23 21:53 ` Karl Fogel
2016-05-25 17:56   ` Matt Lundin
2016-05-25 18:33   ` Matt Lundin
2016-05-25 23:23     ` Karl Fogel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvndsox7.fsf@red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mdl@imapmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).