From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Berry Subject: Bug [w/patch]: TODO blocking doesn't work across files with different TODO keyword sets Date: Sat, 31 Aug 2013 17:37:09 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=90e6ba539e70f2f7bf04e547a752 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFvfE-0000qf-He for emacs-orgmode@gnu.org; Sat, 31 Aug 2013 20:37:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFvfD-00028V-I2 for emacs-orgmode@gnu.org; Sat, 31 Aug 2013 20:37:12 -0400 Received: from mail-ie0-x229.google.com ([2607:f8b0:4001:c03::229]:42944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFvfD-000280-2V for emacs-orgmode@gnu.org; Sat, 31 Aug 2013 20:37:11 -0400 Received: by mail-ie0-f169.google.com with SMTP id tp5so1297101ieb.28 for ; Sat, 31 Aug 2013 17:37:10 -0700 (PDT) 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 --90e6ba539e70f2f7bf04e547a752 Content-Type: text/plain; charset=UTF-8 Hi list, Some of my agenda files use custom TODO keywords (set through a #+SETUPFILE), and some use the standard TODO | DONE keywords. I recently discovered that TODO blocking is broken in the files which use custom keywords. It turns out the org-not-done-heading-regexps variable was global instead of buffer-local like the other *-regexp variables; this appears to be due to a typo in org.el. I think the blocker hook (org-block-todo-from-children-or-siblings-or-parent) was picking up the global value (set by one of the "factory-default" buffers, which got opened last) and applying it to buffers with my custom TODO keywords, so it was not correctly identifying some headlines as TODO headlines. The patch below corrects the typo and fixes TODO blocking in my custom-keyword files. I hope you find it useful. (BTW, I quickly ran through the other make-variable-buffer-local invocations in org.el, and didn't see any more typos of this nature.) Thanks, Josh diff --git a/lisp/org.el b/lisp/org.el index 97b5365..985dd74 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4602,7 +4602,7 @@ Otherwise, these types are allowed: (make-variable-buffer-local 'org-not-done-regexp) (defvar org-not-done-heading-regexp nil "Matches a TODO headline that is not done.") -(make-variable-buffer-local 'org-not-done-regexp) +(make-variable-buffer-local 'org-not-done-heading-regexp) (defvar org-todo-line-regexp nil "Matches a headline and puts TODO state into group 2 if present.") (make-variable-buffer-local 'org-todo-line-regexp) --90e6ba539e70f2f7bf04e547a752 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi list,

Some of my agenda files use= custom TODO keywords (set through a=20 #+SETUPFILE), and some use the standard TODO | DONE keywords.=C2=A0 I recen= tly discovered that TODO blocking is broken in the files which use custom k= eywords.

It turns out the org-not-done-heading-regexps variabl= e was global instead of buffer-local like the other *-regexp variables; thi= s appears to be due to a typo in org.el.

I think the blocker hook (org-block-todo-from-children-or-siblings-or-p= arent) was picking up the global value (set by one of the "factory-def= ault" buffers, which got opened last) and applying it to buffers with = my custom TODO keywords, so it was not correctly identifying some headlines= as TODO headlines.

The patch below corrects the typo and fixes TODO blocking = in my custom-keyword files.=C2=A0 I hope you find it useful.=C2=A0 (BTW, I = quickly ran through the other make-variable-buffer-local invocations in org= .el, and didn't see any more typos of this nature.)

Thanks,
Josh

diff --git a/lisp/org.el b/lisp/org.el
index = 97b5365..985dd74 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -46= 02,7 +4602,7 @@ Otherwise, these types are allowed:
=C2=A0(make-variable= -buffer-local 'org-not-done-regexp)
=C2=A0(defvar org-not-done-heading-regexp nil
=C2=A0=C2=A0 "Matches= a TODO headline that is not done.")
-(make-variable-buffer-local &= #39;org-not-done-regexp)
+(make-variable-buffer-local 'org-not-done-= heading-regexp)
=C2=A0(defvar org-todo-line-regexp nil
=C2=A0=C2=A0 "Matches a head= line and puts TODO state into group 2 if present.")
=C2=A0(make-var= iable-buffer-local 'org-todo-line-regexp)
--90e6ba539e70f2f7bf04e547a752--