mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 19:07:52 +00:00
org: Fix tags extraction
* lisp/org.el (org-get-tags-at): Use non-greedy match up to colon to match all tags (and not just the last.) * testing/lisp/test-org.el (test-org/tags-at): One test to cover the issue.
This commit is contained in:
parent
f94df5456f
commit
7e57cf5d40
|
@ -14870,7 +14870,7 @@ ignore inherited ones."
|
||||||
(org-back-to-heading t)
|
(org-back-to-heading t)
|
||||||
(while (not (equal lastpos (point)))
|
(while (not (equal lastpos (point)))
|
||||||
(setq lastpos (point))
|
(setq lastpos (point))
|
||||||
(when (looking-at ".+:\\([[:alnum:]_@#%:]+\\):[ \t]*$")
|
(when (looking-at ".+?:\\([[:alnum:]_@#%:]+\\):[ \t]*$")
|
||||||
(setq ltags (org-split-string
|
(setq ltags (org-split-string
|
||||||
(match-string-no-properties 1) ":"))
|
(match-string-no-properties 1) ":"))
|
||||||
(when parent
|
(when parent
|
||||||
|
|
|
@ -4509,6 +4509,13 @@ Paragraph<point>"
|
||||||
(org-fix-tags-on-the-fly))
|
(org-fix-tags-on-the-fly))
|
||||||
(buffer-string)))))
|
(buffer-string)))))
|
||||||
|
|
||||||
|
(ert-deftest test-org/tags-at ()
|
||||||
|
(should
|
||||||
|
(equal '("foo" "bar")
|
||||||
|
(org-test-with-temp-text
|
||||||
|
"* T<point>est :foo:bar:"
|
||||||
|
(org-get-tags-at)))))
|
||||||
|
|
||||||
|
|
||||||
;;; Timestamps API
|
;;; Timestamps API
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue