* [PATCH] Fix org-open-at-point to work with tags
@ 2017-08-09 19:30 Galen Menzel
2017-08-10 10:43 ` Nicolas Goaziou
0 siblings, 1 reply; 2+ messages in thread
From: Galen Menzel @ 2017-08-09 19:30 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 325 bytes --]
Hi all,
I notice that org-open-at-point reports "no link found" when the point
is on the tags in a headline, even though the mouse pointer indicates
that emacs regards org tags as a link. I believe this is a bug, which
the attached patch addresses.
Please let me know if I can provide any more information.
Best,
Galen
[-- Attachment #2: 0001-org.el-Fix-org-open-at-point-for-tags.patch --]
[-- Type: text/plain, Size: 1884 bytes --]
From 151da3ae7a495d46f9a14f130e4e2022cecb9fe1 Mon Sep 17 00:00:00 2001
From: Galen Menzel <galen.menzel@utexas.edu>
Date: Wed, 9 Aug 2017 11:57:38 -0700
Subject: [PATCH] org.el: Fix org-open-at-point for tags.
lisp/org.el (org-open-at-point): Move case for tags up so that it's
not shortcutted by the case for no valid context.
TINYCHANGE
---
lisp/org.el | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 2d98ba814..52460d8f6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10633,6 +10633,14 @@ a timestamp or a link."
(org-open-at-point))
(require 'org-attach)
(org-attach-reveal 'if-exists))))
+ ;; On tags within a headline or an inlinetask.
+ ((and (memq type '(headline inlinetask))
+ (let ((case-fold-search nil))
+ (save-excursion (beginning-of-line)
+ (looking-at org-complex-heading-regexp))
+ (and (match-beginning 5)
+ (>= (point) (match-beginning 5)))))
+ (org-tags-view arg (substring (match-string 5) 0 -1)))
;; On a footnote reference or at definition's label.
((or (eq type 'footnote-reference)
(and (eq type 'footnote-definition)
@@ -10668,14 +10676,6 @@ a timestamp or a link."
(point)))
(user-error "No link found"))
((eq type 'timestamp) (org-follow-timestamp-link))
- ;; On tags within a headline or an inlinetask.
- ((and (memq type '(headline inlinetask))
- (let ((case-fold-search nil))
- (save-excursion (beginning-of-line)
- (looking-at org-complex-heading-regexp))
- (and (match-beginning 5)
- (>= (point) (match-beginning 5)))))
- (org-tags-view arg (substring (match-string 5) 0 -1)))
((eq type 'link)
(let ((type (org-element-property :type context))
(path (org-link-unescape (org-element-property :path context))))
--
2.14.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix org-open-at-point to work with tags
2017-08-09 19:30 [PATCH] Fix org-open-at-point to work with tags Galen Menzel
@ 2017-08-10 10:43 ` Nicolas Goaziou
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-08-10 10:43 UTC (permalink / raw)
To: Galen Menzel; +Cc: emacs-orgmode
Hello,
"Galen Menzel" <galen.menzel@utexas.edu> writes:
> Subject: [PATCH] org.el: Fix org-open-at-point for tags.
>
> lisp/org.el (org-open-at-point): Move case for tags up so that it's
> not shortcutted by the case for no valid context.
Applied, with some refactoring. Thank you.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-10 10:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09 19:30 [PATCH] Fix org-open-at-point to work with tags Galen Menzel
2017-08-10 10:43 ` Nicolas Goaziou
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.