* 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.
@@ -14870,7 +14870,7 @@ ignore inherited ones."
(org-back-to-heading t)
(while (not (equal lastpos (point)))
(setq lastpos (point))
- (when (looking-at ".+:\\([[:alnum:]_@#%:]+\\):[ \t]*$")
+ (when (looking-at ".+?:\\([[:alnum:]_@#%:]+\\):[ \t]*$")
(setq ltags (org-split-string
(match-string-no-properties 1) ":"))
(when parent
@@ -4509,6 +4509,13 @@ Paragraph<point>"
(org-fix-tags-on-the-fly))
(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