emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] quick patch to org-habit todo state keywords


From: Aaron Ecay
Subject: Re: [O] [PATCH] quick patch to org-habit todo state keywords
Date: Sun, 15 Dec 2013 23:27:12 -0500
User-agent: Notmuch/0.16+154~g96c0ce2 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu)

Hi Ted,

Welcome to org-mode, and thanks for the patch!

I have one small comment:

2013ko abenudak 15an, Ted Wiles-ek idatzi zuen:
> 
> Took out the hardcoded todo-state
> 
> * lisp/org-habit.el 
> 
>   The "DONE" keyword was hardcoded in. This is my first patch (ever, to 
> anything).
> 
>   TINYCHANGE
> 
> 1 file changed, 2 insertions(+), 1 deletion(-)
>  lisp/org-habit.el |    3 ++-
> 
>       Modified   lisp/org-habit.el
> diff --git a/lisp/org-habit.el b/lisp/org-habit.el
> index eba9037..69d0fa6 100644
> --- a/lisp/org-habit.el
> +++ b/lisp/org-habit.el
> @@ -200,7 +200,8 @@ This list represents a \"habit\" for the rest of this 
> module."
>            (count 0))
>       (unless reversed (goto-char end))
>       (while (and (< count maxdays)
> -                 (funcall search "- State \"DONE\".*\\[\\([^]]+\\)\\]" limit 
> t))
> +                 (funcall search (format "- State \"%s\".*\\[\\([^]]+\\)\\]" 
> +                                         (car (reverse (car 
> org-todo-keywords)))) limit t))

I think this will not be the correct value when the org-todo-keywords
variable contains characters for fast todo selection (cf. the fifth
paragraph of the docstring at C-h v org-todo-keywords).  For example, my
org-todo-keywords is set to:
((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
 (sequence "WAIT(w@/!)" "|" "CANCELLED(c@/!)"))

I think you can get the value you want with:
(concat "\\(" (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)")

The org-done-keywords variable is not documented, but it is set (locally
in each buffer) to the list of done keywords in that buffer by the code
that initializes org mode.  (I found and slightly adapted the above bit
of code from line 6283 of org.el, where some fontification regexps are
calculated.)

Aaron

PS You should make a new message to the list when you send a new patch,
rather than replying to another one.  The replies interfere with the
threading algorithms in some MUAs which parse the References or
In-Reply-To header of the email in order to determine its parent.

-- 
Aaron Ecay



reply via email to

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