From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans-Peter Deifel Subject: Custom agenda and DONE faces Date: Wed, 15 Feb 2012 18:19:54 +0100 Message-ID: <87r4xwypxh.fsf@hpdeifel.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxiWY-00016u-LN for emacs-orgmode@gnu.org; Wed, 15 Feb 2012 12:20:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxiWN-0005JS-P1 for emacs-orgmode@gnu.org; Wed, 15 Feb 2012 12:20:10 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]:51693) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RxiWM-0005Iq-TW for emacs-orgmode@gnu.org; Wed, 15 Feb 2012 12:19:59 -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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi all, In custom agenda-list views, DONE keywords are highlighted with the org-todo face, instead of org-done. This has been posted before[1], but not solved. Steps to reproduce: 1. Create a custom agenda: #+begin_src emacs-lisp (setq org-agenda-custom-commands '(("x" "Agenda" ((agenda ""))))) #+end_src 2. Create a new file, add a DONE item and schedule it for today. Add the file to org-agenda-files. 3. Open the custom agenda (possibly with `C-c a x') The "DONE" keyword will be red instead of green. This doesn't happen in the normal agenda view (`C-c a a'). Typing 'C-u C-x =' on it reveals: #+begin_ascii position: 108 of 315 (34%), column: 28 character: N (displayed as N) (codepoint 78, #o116, #x4e) preferred charset: ascii (ASCII (ISO646 IRV)) code point in charset: 0x4E syntax: w which means: word category: .:Base, L:Left-to-right (strong), a:ASCII, l:Latin, r:Roman buffer code: #x4E file code: #x4E (encoded by coding system utf-8-unix) display: by this font (glyph code) xft:-unknown-DejaVu Sans Mono-bold-normal-normal-*-11-*-*-*-m-0-iso10646-1 (#x31) Character code properties: customize what to show name: LATIN CAPITAL LETTER N old-name: general-category: Lu (Letter, Uppercase) decomposition: (78) ('N') There are text properties here: date (2 14 2012) day 734547 done-face org-agenda-done dotime time duration nil effort "" effort-minutes nil extra "Scheduled: " face org-todo format [Show] help-echo "mouse-2 or RET jump to org file ~/notes/todo.org" mouse-face highlight org-agenda-type agenda org-category "todo" org-category-position nil org-complex-heading-regexp [Show] org-day-cnt 2 org-habit-p nil org-hd-marker # org-heading t org-highest-priority 65 org-lowest-priority 67 org-marker # org-not-done-regexp "\\(TODO\\)" org-todo-regexp "\\(TODO\\|DONE\\)" priority 1099 tags nil time "" time-of-day nil todo-state [Show] txt [Show] type "scheduled" undone-face org-scheduled #+end_ascii I played around in the source code and noticed that the following patch fixes the problem, but I don't know the code base well enough to understand why it works and what other implications it might have: #+begin_src diff diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 67e06c0..b12b0d4 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3094,7 +3094,6 @@ the global options and expect it to be applied to the entire view.") (defun org-prepare-agenda (&optional name) (setq org-todo-keywords-for-agenda nil) - (setq org-done-keywords-for-agenda nil) (setq org-drawers-for-agenda nil) (unless org-agenda-persistent-filter (setq org-agenda-tag-filter nil @@ -3113,6 +3112,7 @@ the global options and expect it to be applied to the entire view.") (make-string (window-width) org-agenda-block-separator)) "\n")) (narrow-to-region (point) (point-max))) + (setq org-done-keywords-for-agenda nil) (org-agenda-reset-markers) (setq org-agenda-contributing-files nil) (setq org-agenda-columns-active nil) #+end_src I use Emacs 24 from bzr and org-mode from git. Thanks in advance, Hans-Peter [1] http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00332.html