summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Wahl <marcowahlsoft@gmail.com>2016-06-09 09:39:38 +0200
committerMarco Wahl <marcowahlsoft@gmail.com>2016-06-09 10:06:14 +0200
commit7e57cf5d405f48f31650eac3297e29d8189e58cf (patch)
tree90ee27c5b553c5cf674863d346b7c167927b872a
parentf94df5456fcfb1125f9dc2c15904559bae2bb3de (diff)
downloadorg-mode-7e57cf5d405f48f31650eac3297e29d8189e58cf.tar.gz
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.
-rw-r--r--lisp/org.el2
-rw-r--r--testing/lisp/test-org.el7
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index fc3e0c0..206ebad 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -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
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 680c45c..4765d9d 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -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