diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2009-08-02 15:51:26 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2009-08-02 15:51:26 +0200 |
commit | 98998abc0db33e05295fb8fe77949cb37f75b2b2 (patch) | |
tree | f2f6fa282ee65c72ecac26f1bc1138102d193bdf | |
parent | 34683b03e0857be0e2b071b50f489597a617a4bf (diff) | |
download | org-mode-98998abc0db33e05295fb8fe77949cb37f75b2b2.tar.gz |
ID links: Honor `org-link-frame-setup'.
-rwxr-xr-x | lisp/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/org-id.el | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 10d16f9..dbfc70f 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2009-08-02 Carsten Dominik <carsten.dominik@gmail.com> + + * org-id.el (org-id-open): Honor `org-link-frame-setup'. + 2009-08-01 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-as-org): Insert the "-source" string diff --git a/lisp/org-id.el b/lisp/org-id.el index 2f08fe3..4fe6e60 100644 --- a/lisp/org-id.el +++ b/lisp/org-id.el @@ -577,11 +577,22 @@ optional argument MARKERP, return the position as a new marker." (defun org-id-open (id) "Go to the entry with id ID." (org-mark-ring-push) - (let ((m (org-id-find id 'marker))) + (let ((m (org-id-find id 'marker)) + cmd) (unless m (error "Cannot find entry with ID \"%s\"" id)) + ;; Use a buffer-switching command in analogy to finding files + (setq cmd + (or + (cdr + (assq + (cdr (assq 'file org-link-frame-setup)) + '((find-file . switch-to-buffer) + (find-file-other-window . switch-to-buffer-other-window) + (find-file-other-frame . switch-to-buffer-other-frame)))) + switch-to-buffer-other-window)) (if (not (equal (current-buffer) (marker-buffer m))) - (switch-to-buffer-other-window (marker-buffer m))) + (funcall cmd (marker-buffer m))) (goto-char m) (move-marker m nil) (org-show-context))) |