From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: org-notmuch: how to open-link-at-point in other window? Date: Thu, 21 May 2015 20:10:22 +0200 Message-ID: <20150521181022.GC19311@chitra.no-ip.org> References: <20150521130913.GA28718@boo.workgroup> <874mn6546k.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvUvN-0000pn-QV for emacs-orgmode@gnu.org; Thu, 21 May 2015 14:10:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvUvJ-0006G8-Ip for emacs-orgmode@gnu.org; Thu, 21 May 2015 14:10:29 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:35311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvUvJ-0006Fu-Bm for emacs-orgmode@gnu.org; Thu, 21 May 2015 14:10:25 -0400 Received: by wicmx19 with SMTP id mx19so23692086wic.0 for ; Thu, 21 May 2015 11:10:24 -0700 (PDT) Received: from chitra.no-ip.org ([2001:610:120:3001:2ad2:44ff:fe4a:b029]) by mx.google.com with ESMTPSA id kc4sm33246397wjc.2.2015.05.21.11.10.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 May 2015 11:10:24 -0700 (PDT) Content-Disposition: inline In-Reply-To: <874mn6546k.fsf@kyleam.com> 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@gnu.org On Thu, May 21, 2015 at 11:41:07AM -0400, Kyle Meyer wrote: > 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’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.