From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [PATCH] quick patch to org-habit todo state keywords Date: Sun, 15 Dec 2013 23:27:12 -0500 Message-ID: <87a9g1fmjj.fsf@gmail.com> References: <87ppp415n4.fsf@gmail.com> <87bo0nu79v.fsf@gmail.com> <87haaf1bgi.fsf@gmail.com> <8761qvxg2o.fsf@gmail.com> <87r49ik0qw.fsf@gmail.com> <87txeevus8.fsf@gmail.com> <87ob4lkhmo.fsf@gmail.com> <87lhzpx0d7.fsf@gmail.com> <87fvptfpuy.fsf@gmail.com> <87haa9a363.fsf@dorewiles.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsPm8-00013v-23 for emacs-orgmode@gnu.org; Sun, 15 Dec 2013 23:27:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsPlz-0006Z4-H2 for emacs-orgmode@gnu.org; Sun, 15 Dec 2013 23:27:23 -0500 Received: from mail-qe0-x234.google.com ([2607:f8b0:400d:c02::234]:58590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsPlz-0006Ys-C3 for emacs-orgmode@gnu.org; Sun, 15 Dec 2013 23:27:15 -0500 Received: by mail-qe0-f52.google.com with SMTP id ne12so3457613qeb.39 for ; Sun, 15 Dec 2013 20:27:14 -0800 (PST) In-Reply-To: <87haa9a363.fsf@dorewiles.com> 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: Ted Wiles Cc: "emacs-orgmode@gnu.org" 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