diff --git a/lisp/org.el b/lisp/org.el index 46fb2ab8a..e9dc187b3 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -10709,15 +10709,16 @@ link in a property drawer line." (org-element-lineage (org-element-context) '(comment comment-block footnote-definition footnote-reference - headline inlinetask link node-property timestamp) + headline inlinetask keyword link node-property + timestamp) t)) (type (org-element-type context)) (value (org-element-property :value context))) (cond ((not context) (user-error "No link found")) - ;; Exception: open timestamps and links in properties drawers - ;; and comments. - ((memq type '(comment comment-block node-property)) + ;; Exception: open timestamps and links in properties + ;; drawers, keywords and comments. + ((memq type '(comment comment-block keyword node-property)) (cond ((org-in-regexp org-any-link-re) (org-open-link-from-string (match-string-no-properties 0))) ((or (org-at-timestamp-p t) (org-at-date-range-p t)) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 543a49094..3c4d34da0 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -1496,15 +1496,22 @@ drops support for Emacs 24.1 and 24.2." ;;;; Open at point +(ert-deftest test-org/open-at-point-in-keyword () + "Does `org-open-at-point' open link in a keyword line?" + (should + (org-test-with-temp-text + "#+KEYWORD: [[info:emacs#Top]]" + (org-open-at-point) t))) + (ert-deftest test-org/open-at-point-in-property () "Does `org-open-at-point' open link in property drawer?" (should (org-test-with-temp-text - "* Headline + "* Headline :PROPERTIES: :URL: [[info:emacs#Top]] :END:" - (org-open-at-point) t))) + (org-open-at-point) t))) (ert-deftest test-org/open-at-point-in-comment () "Does `org-open-at-point' open link in a commented line?"