From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: org-notmuch: how to open-link-at-point in other window? Date: Thu, 21 May 2015 11:41:07 -0400 Message-ID: <874mn6546k.fsf@kyleam.com> References: <20150521130913.GA28718@boo.workgroup> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvSay-0007wL-9b for emacs-orgmode@gnu.org; Thu, 21 May 2015 11:41:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvSas-0005q7-DM for emacs-orgmode@gnu.org; Thu, 21 May 2015 11:41:16 -0400 Received: from mail-qk0-f175.google.com ([209.85.220.175]:32875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvSas-0005q0-A1 for emacs-orgmode@gnu.org; Thu, 21 May 2015 11:41:10 -0400 Received: by qkgv12 with SMTP id v12so57934829qkg.0 for ; Thu, 21 May 2015 08:41:09 -0700 (PDT) Received: from localhost (nat-130-132-173-5.central.yale.edu. [130.132.173.5]) by mx.google.com with ESMTPSA id q85sm13540035qkh.35.2015.05.21.08.41.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 May 2015 08:41:08 -0700 (PDT) In-Reply-To: <20150521130913.GA28718@boo.workgroup> (Gregor Zattler's message of "Thu, 21 May 2015 15:09:13 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Gregor Zattler 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=E2=80=99t know how to do so with notmuch: > links. Universal argument won=E2=80=99t help. > > Any ideas? 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 -- Kyle