diff options
author | Marco Wahl <marcowahlsoft@gmail.com> | 2019-02-13 23:29:26 +0100 |
---|---|---|
committer | Marco Wahl <marcowahlsoft@gmail.com> | 2019-02-13 23:29:26 +0100 |
commit | ba974fecf933e2e74782008924e95c7a3cebde81 (patch) | |
tree | 616f9398f836c48d39659530aa1793442c8b93dd | |
parent | 84a8fe1dd95f140d39ce69cfab57659b3f394bd9 (diff) | |
download | org-mode-ba974fecf933e2e74782008924e95c7a3cebde81.tar.gz |
org: Refine open at point for tags to use just the tag at point
* lisp/org.el (org-open-at-point): On a tag open a tags view for just
the tag at point. Recent behavior for multiple tags was to open a
tags view for the complete tag string.
-rw-r--r-- | lisp/org.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el index f13d528..5c00835 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10086,7 +10086,14 @@ a link." (>= (point) (match-beginning 5)) (< (point) (match-end 5))) ;; On tags. - (org-tags-view arg (substring (match-string 5) 0 -1)) + (org-tags-view + arg + (save-excursion + (let* ((beg (match-beginning 5)) + (end (match-end 5)) + (beg-tag (or (search-backward ":" beg 'at-limit) (point))) + (end-tag (search-forward ":" end nil 2))) + (buffer-substring (1+ beg-tag) (1- end-tag))))) ;; Not on tags. (pcase (org-offer-links-in-entry (current-buffer) (point) arg) (`(nil . ,_) |