浏览代码

Fix `org-open-at-point' in comments

* lisp/org.el (org-open-at-point): Return an error in comments, as
  there are no link to be found.
Nicolas Goaziou 11 年之前
父节点
当前提交
3917776995
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lisp/org.el

+ 1 - 0
lisp/org.el

@@ -10480,6 +10480,7 @@ is used internally by `org-open-link-from-string'."
 					  footnote-reference timestamp)))
 					  footnote-reference timestamp)))
 		    (setq context (org-element-property :parent context))))
 		    (setq context (org-element-property :parent context))))
 	(cond
 	(cond
+	 ((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))