Small fix

* lisp/org.el (org-open-at-point): Use parser instead of
  `org-at-comment-p' and `org-at-property-p', which are not accurate.
This commit is contained in:
Nicolas Goaziou 2014-05-26 18:13:45 +02:00
parent f574744aee
commit 0e303ab577
1 changed files with 6 additions and 5 deletions

View File

@ -10606,17 +10606,18 @@ is used internally by `org-open-link-from-string'."
;; On an unsupported type, check if point is contained within ;; On an unsupported type, check if point is contained within
;; a support one. ;; a support one.
(while (and (not (memq (setq type (org-element-type context)) (while (and (not (memq (setq type (org-element-type context))
'(headline inlinetask link footnote-definition '(comment headline inlinetask link
footnote-reference timestamp))) footnote-definition footnote-reference
node-property timestamp)))
(setq context (org-element-property :parent context)))) (setq context (org-element-property :parent context))))
(cond (cond
;; Blank lines at the beginning of buffer: bail out.
((not context) (user-error "No link found"))
;; WARNING: Before checking for syntactically correct ;; WARNING: Before checking for syntactically correct
;; contexts, we make two exceptions as we open links in ;; contexts, we make two exceptions as we open links in
;; comments and properties. ;; comments and properties.
((or (org-at-comment-p) (org-at-property-p)) ((memq type '(comment node-property))
(org-open-link-in-comment-or-property)) (org-open-link-in-comment-or-property))
;; Now check for context where link opening is not supported.
((not context) (user-error "No link found"))
;; On a headline or an inlinetask, but not on a timestamp, ;; On a headline or an inlinetask, but not on a timestamp,
;; a link, a footnote reference or on tags. ;; a link, a footnote reference or on tags.
((and (memq type '(headline inlinetask)) ((and (memq type '(headline inlinetask))