diff options
author | Michael Brand <michael.ch.brand@gmail.com> | 2012-01-25 18:24:58 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-01-28 15:48:04 +0100 |
commit | d9ac2ffa37fe0f7f99890c1be565bb223ce50011 (patch) | |
tree | dd2e8a5a39adb89c633882713be06dc4d4274995 | |
parent | 843ac278f911e0a017356d570a4f31ded172fe49 (diff) | |
download | org-mode-d9ac2ffa37fe0f7f99890c1be565bb223ce50011.tar.gz |
Link to Org file: regard startup view state
* lisp/org.el (org-open-link-from-string): Regard `reference-buffer'
when setting `org-inhibit-startup'.
When opening a link to another Org file not yet opened (first close it
if opened) before this patch:
1) When point is on the line with the link and the line is not a
heading then the target file is opened with the target file startup
view state, e. g. the default OVERVIEW.
2) When point is on the heading of the entry of which the link is part
of then the target file is opened with "SHOW ALL". But it is
expected to regard the target file startup view state like case 1).
Note: Only in case 2) `org-open-at-point' uses
`org-offer-links-in-entry' and from there `org-open-link-from-string'.
example current buffer with link:
#+BEGIN_SRC org
,* section
, [[file:myfile.org::*mytarget]]
#+END_SRC
example target file myfile.org:
#+BEGIN_SRC org
,* mytarget
, text
,*** subsection
#+END_SRC
-rw-r--r-- | lisp/org.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el index 67ea52b..4af7418 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9439,7 +9439,7 @@ Org-mode syntax." (interactive "sLink: \nP") (let ((reference-buffer (or reference-buffer (current-buffer)))) (with-temp-buffer - (let ((org-inhibit-startup t)) + (let ((org-inhibit-startup (not reference-buffer))) (org-mode) (insert s) (goto-char (point-min)) |