From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karl Fogel Subject: Re: Displaying deadline datestamp in todo agenda list? Date: Wed, 25 May 2016 18:23:00 -0500 Message-ID: <87mvndsox7.fsf@red-bean.com> References: <87oa7wu1si.fsf@red-bean.com> <87bn3wo306.fsf@red-bean.com> <87h9dmrnqv.fsf@fastmail.fm> Reply-To: Karl Fogel Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5i8s-0007Vk-Hh for emacs-orgmode@gnu.org; Wed, 25 May 2016 19:23:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5i8m-0004Qy-F3 for emacs-orgmode@gnu.org; Wed, 25 May 2016 19:23:09 -0400 Received: from mail-it0-x22f.google.com ([2607:f8b0:4001:c0b::22f]:34534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5i8m-0004Qt-9P for emacs-orgmode@gnu.org; Wed, 25 May 2016 19:23:04 -0400 Received: by mail-it0-x22f.google.com with SMTP id g126so16410ite.1 for ; Wed, 25 May 2016 16:23:03 -0700 (PDT) In-Reply-To: <87h9dmrnqv.fsf@fastmail.fm> (Matt Lundin's message of "Wed, 25 May 2016 13:33:44 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode Cc: Matt Lundin Matt Lundin 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