0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-26 12:32:53 +00:00

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.
This commit is contained in:
Carsten Dominik 2009-03-25 09:20:12 +01:00
parent 6a7c9ad05d
commit 70b975f89c
3 changed files with 9 additions and 2 deletions

View file

@ -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.

View file

@ -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

View file

@ -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)))