emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to open ID links in a new window?
@ 2021-01-24  6:03 arozbiz
  2021-02-12  6:09 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: arozbiz @ 2021-01-24  6:03 UTC (permalink / raw)
  To: Emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

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.

Thanks,
Alan

[-- Attachment #2: Type: text/html, Size: 332 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to open ID links in a new window?
  2021-01-24  6:03 How to open ID links in a new window? arozbiz
@ 2021-02-12  6:09 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2021-02-12  6:09 UTC (permalink / raw)
  To: arozbiz; +Cc: Emacs-orgmode

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?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-12  6:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-24  6:03 How to open ID links in a new window? arozbiz
2021-02-12  6:09 ` Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).