emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Hans-Peter Deifel <hpdeifel@gmx.de>
To: emacs-orgmode@gnu.org
Subject: Custom agenda and DONE faces
Date: Wed, 15 Feb 2012 18:19:54 +0100	[thread overview]
Message-ID: <87r4xwypxh.fsf@hpdeifel.de> (raw)

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        #<marker at 8712 in todo.org>
    org-heading          t
    org-highest-priority 65
    org-lowest-priority  67
    org-marker           #<marker at 8779 in todo.org>
    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

             reply	other threads:[~2012-02-15 17:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15 17:19 Hans-Peter Deifel [this message]
2012-03-18 17:02 ` Custom agenda and DONE faces David Maus

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=87r4xwypxh.fsf@hpdeifel.de \
    --to=hpdeifel@gmx.de \
    --cc=emacs-orgmode@gnu.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).