emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: org-notmuch: how to open-link-at-point in other window?
Date: Thu, 21 May 2015 20:10:22 +0200	[thread overview]
Message-ID: <20150521181022.GC19311@chitra.no-ip.org> (raw)
In-Reply-To: <874mn6546k.fsf@kyleam.com>

On Thu, May 21, 2015 at 11:41:07AM -0400, Kyle Meyer wrote:
> Gregor Zattler <telegraph@gmx.net> wrote:
> > Dear org-moders,
> >
> > I want to open-link-at-point (C-c C-o) in other window.  With
> > file links this is standard behaviour (at least with my
> > configuration).  But I don’t know how to do so with notmuch:
> > links.  Universal argument won’t help.
> 
> org-notmuch-follow-link calls notmuch-show, which uses switch-to-buffer.
> You can set org-notmuch-open-function to a function that behaves the way
> you want.  There are probably cleaner ways to handle this, but below
> seems to work.
> 
> #+begin_src elisp
>   (setq org-notmuch-open-function 'org-notmuch-follow-link-other-window)
> 
>   (defun org-notmuch-follow-link-other-window (search)
>     "Like `org-notmuch-follow-link', but use other window."
>     (pop-to-buffer (save-window-excursion
>                      (notmuch-show (org-link-unescape search)))))
> #+end_src

I think this (writing your own defun) is the cleanest way to handle
this.  There is no way for Org to ensure a consistent behaviour for all
possible link types, there are too many.  Org can ensure consistency
only for physical files, and even then when they are opened inside
Emacs.  There is no shortage of links to binary files!

For what it's worth, I have customised notmuch open function to use the
notmuch-tree interface.

-- 
Suvayu

Open source is the future. It sets us free.

  reply	other threads:[~2015-05-21 18:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 13:09 org-notmuch: how to open-link-at-point in other window? Gregor Zattler
2015-05-21 13:35 ` Leo Ufimtsev
2015-05-21 13:42   ` Gregor Zattler
2015-05-21 14:27     ` Subhan Michael Tindall
2015-05-21 15:41 ` Kyle Meyer
2015-05-21 18:10   ` Suvayu Ali [this message]
2015-05-21 18:41     ` Kyle Meyer

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=20150521181022.GC19311@chitra.no-ip.org \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).