[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to open ID links in a new window?
From: |
Kyle Meyer |
Subject: |
Re: How to open ID links in a new window? |
Date: |
Fri, 12 Feb 2021 01:09:55 -0500 |
arozbiz@gmail.com writes:
> I would like to open ID links [[id:...]] in a new window. I can make file
> links [[file:...]] open in a new window by running (add-to-list
> 'org-link-frame-setup '(file . find-file-other-window)), but this doesn't
> seem to affect the behavior of ID links.
Here's the full definition of org-id-open:
(defun org-id-open (id _)
"Go to the entry with id ID."
(org-mark-ring-push)
(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
<1> (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))
<2> (if (not (equal (current-buffer) (marker-buffer m)))
(funcall cmd (marker-buffer m)))
(goto-char m)
(move-marker m nil)
(org-show-context)))
So org-id-open does look at org-link-frame-setup (<1>), though that's
only in effect when the target isn't in the current buffer (<2>).
Are you observing the behavior you describe when the target is in
another buffer?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: How to open ID links in a new window?,
Kyle Meyer <=