Fix bug with tag inheritance.

This bug caused (org-get-tags-at) to return no tags at all
when inheritance was turned off, even if the entry
does have local tags.
This commit is contained in:
Carsten Dominik 2008-09-20 12:32:35 +02:00
parent 6697584704
commit 43e6633a15
2 changed files with 20 additions and 16 deletions

View File

@ -2,6 +2,7 @@
* org.el (org-refile): Allow refiling to the last entry in the
buffer.
(org-get-tags-at): Fix bug when inheritance is turned off.
2008-09-19 Carsten Dominik <dominik@science.uva.nl>

View File

@ -9746,22 +9746,25 @@ ignore inherited ones."
(widen)
(goto-char (or pos (point)))
(save-match-data
(condition-case nil
(progn
(org-back-to-heading t)
(while (not (equal lastpos (point)))
(setq lastpos (point))
(when (looking-at (org-re "[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*$"))
(setq ltags (org-split-string
(org-match-string-no-properties 1) ":"))
(setq tags (append (org-remove-uniherited-tags ltags)
tags)))
(or org-use-tag-inheritance (error ""))
(if local
(setq lastpos (point)) ; stop here
(org-up-heading-all 1))
(setq parent t)))
(error nil))))
(catch 'done
(condition-case nil
(progn
(org-back-to-heading t)
(while (not (equal lastpos (point)))
(setq lastpos (point))
(when (looking-at (org-re "[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*$"))
(setq ltags (org-split-string
(org-match-string-no-properties 1) ":"))
(setq tags (append
(if parent
(org-remove-uniherited-tags ltags)
ltags)
tags)))
(or org-use-tag-inheritance (throw 'done t))
(if local (throw 'done t))
(org-up-heading-all 1)
(setq parent t)))
(error nil)))))
(append (org-remove-uniherited-tags org-file-tags) tags))))
(defun org-toggle-tag (tag &optional onoff)