emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-notmuch: how to open-link-at-point in other window?


From: Suvayu Ali
Subject: Re: [O] org-notmuch: how to open-link-at-point in other window?
Date: Thu, 21 May 2015 20:10:22 +0200
User-agent: Mutt/1.5.23.1-rc1 (2014-03-12)

On Thu, May 21, 2015 at 11:41:07AM -0400, Kyle Meyer wrote:
> Gregor Zattler <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]