emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: arozbiz@gmail.com
Cc: Emacs-orgmode@gnu.org
Subject: Re: How to open ID links in a new window?
Date: Fri, 12 Feb 2021 01:09:55 -0500	[thread overview]
Message-ID: <87blcp95qk.fsf@kyleam.com> (raw)
In-Reply-To: <CAJniy+MxgEiM1xdRoir7CyagndHN_o4SgxqVu+u1eo8TY5Uk0g@mail.gmail.com>

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?


      reply	other threads:[~2021-02-12  6:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24  6:03 How to open ID links in a new window? arozbiz
2021-02-12  6:09 ` Kyle Meyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blcp95qk.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=Emacs-orgmode@gnu.org \
    --cc=arozbiz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).