From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Galen Menzel" Subject: [PATCH] Fix org-open-at-point to work with tags Date: Wed, 09 Aug 2017 12:30:13 -0700 Message-ID: <49A5C237-93A3-4205-8BE1-7FCF84DB15B8@utexas.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_MailMate_BF3BF0F5-B97C-45CA-BD6B-F4BA61461088_=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfWgM-0008U4-T7 for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 15:30:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfWgL-0005Ih-6v for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 15:30:18 -0400 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]:36242) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfWgK-0005IA-Uq for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 15:30:17 -0400 Received: by mail-pf0-x230.google.com with SMTP id c28so31674094pfe.3 for ; Wed, 09 Aug 2017 12:30:16 -0700 (PDT) Received: from [192.168.0.107] ([2601:600:c200:ccb6:e102:a124:a140:4662]) by smtp.gmail.com with ESMTPSA id y25sm9428349pfk.162.2017.08.09.12.30.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Aug 2017 12:30:14 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=_MailMate_BF3BF0F5-B97C-45CA-BD6B-F4BA61461088_= Content-Type: text/plain; format=flowed 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 --=_MailMate_BF3BF0F5-B97C-45CA-BD6B-F4BA61461088_= Content-Disposition: attachment; filename=0001-org.el-Fix-org-open-at-point-for-tags.patch Content-Transfer-Encoding: quoted-printable =46rom 151da3ae7a495d46f9a14f130e4e2022cecb9fe1 Mon Sep 17 00:00:00 2001 From: Galen Menzel 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) + (>=3D (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) - (>=3D (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 --=_MailMate_BF3BF0F5-B97C-45CA-BD6B-F4BA61461088_=--