emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Josh Berry <des@condordes.net>
To: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <CAFS7LfMaynn1-rceShDOBgiRB4EtM=QQ8VhDnvXFRrTN++cyzQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]

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)

[-- Attachment #2: Type: text/html, Size: 1748 bytes --]

                 reply	other threads:[~2013-09-01  0:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAFS7LfMaynn1-rceShDOBgiRB4EtM=QQ8VhDnvXFRrTN++cyzQ@mail.gmail.com' \
    --to=des@condordes.net \
    --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).