浏览代码

org.el (org-open-file): Reveal context around point

* org.el (org-open-file): Reveal context around point when
opening a link to an Org file with a line number.

Thanks to François Pinard for suggesting this.
Bastien Guerry 11 年之前
父节点
当前提交
e63b87a46f
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lisp/org.el

+ 3 - 1
lisp/org.el

@@ -11086,7 +11086,9 @@ If the file does not exist, an error is thrown."
 	  (eq cmd 'emacs))
       (funcall (cdr (assq 'file org-link-frame-setup)) file)
       (widen)
-      (if line (org-goto-line line)
+      (if line (progn (org-goto-line line)
+		      (if (derived-mode-p 'org-mode)
+			  (org-reveal)))
 	(if search (org-link-search search))))
      ((consp cmd)
       (let ((file (convert-standard-filename file)))