summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-03-25 09:20:12 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2009-03-25 09:20:12 +0100
commit70b975f89cbabec846e13c76ba656bc261783fa7 (patch)
tree2b9f22b9afa8d452496e801074f7318ec4c3daea
parent6a7c9ad05d243cda7a5fd4047184fec0d801beba (diff)
downloadorg-mode-70b975f89cbabec846e13c76ba656bc261783fa7.tar.gz
Agenda: Fix bugs with FILETAGS
Harri Kiiskinen writes: > It seems that org-use-tag-inheritance set to regexp, the use of > #+FILETAGS: and org-todo-list do not work together. It seems, that a > regexp in org-use-tag-inheritance matching a tag set in #+FILETAGS > causes this error: > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > string-match("^ +" nil) > [...] > when org-use-tag-inheritance is set to regexp "te" > with this file: > > -------- > #+STARTUP: > #+FILETAGS: tea > * TODO testing :test: > ** TODO too :data: > ----- > > When the regexp is "tes", so that the FILETAG does not match, > org-todo-list produces a correct list. This is indeed a bug. The all to `org-get-tags-at' does change the match data if there is a match for the inheritance regexp. This problem is now avoided by first extracting (match-string 1), and then getting the tags. Studying this bug also exposed another one, namely that file tags are not marked as inherited tags. This is now fixed, immediately when the #+FILETAGS line is parsed.
-rwxr-xr-xlisp/ChangeLog5
-rw-r--r--lisp/org-agenda.el3
-rw-r--r--lisp/org.el3
3 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ee630cb..6096d2b 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-25 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-get-todos): Fix bug with match-data.
+ (org-agenda-get-todos): Mark file tags as inherited.
+
2009-03-24 Carsten Dominik <carsten.dominik@gmail.com>
* org-feed.el (org-feed-assume-stable): New option.
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index e53c13f..61b1ba2 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3574,8 +3574,9 @@ the documentation of `org-diary'."
(goto-char (match-beginning 1))
(setq marker (org-agenda-new-marker (match-beginning 0))
category (org-get-category)
+ txt (match-string 1)
tags (org-get-tags-at (point))
- txt (org-format-agenda-item "" (match-string 1) category tags)
+ txt (org-format-agenda-item "" txt category tags)
priority (1+ (org-get-priority txt))
todo-state (org-get-todo-state))
(org-add-props txt props
diff --git a/lisp/org.el b/lisp/org.el
index d212108..99c6ff2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3426,7 +3426,8 @@ means to push this value onto the list in the variable.")
(org-set-local 'org-lowest-priority (nth 1 prio))
(org-set-local 'org-default-priority (nth 2 prio)))
(and props (org-set-local 'org-file-properties (nreverse props)))
- (and ftags (org-set-local 'org-file-tags ftags))
+ (and ftags (org-set-local 'org-file-tags
+ (mapcar 'org-add-prop-inherited ftags)))
(and drawers (org-set-local 'org-drawers drawers))
(and arch (org-set-local 'org-archive-location arch))
(and links (setq org-link-abbrev-alist-local (nreverse links)))