From: "Galen Menzel" <galen.menzel@utexas.edu>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix org-open-at-point to work with tags
Date: Wed, 09 Aug 2017 12:30:13 -0700 [thread overview]
Message-ID: <49A5C237-93A3-4205-8BE1-7FCF84DB15B8@utexas.edu> (raw)
[-- 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
next reply other threads:[~2017-08-09 19:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 19:30 Galen Menzel [this message]
2017-08-10 10:43 ` [PATCH] Fix org-open-at-point to work with tags Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49A5C237-93A3-4205-8BE1-7FCF84DB15B8@utexas.edu \
--to=galen.menzel@utexas.edu \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.