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 14:41:04 -0400 Message-ID: <874mn5g4e7.fsf@kyleam.com> References: <20150521130913.GA28718@boo.workgroup> <874mn6546k.fsf@kyleam.com> <20150521181022.GC19311@chitra.no-ip.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvVP4-0005LM-Bg for emacs-orgmode@gnu.org; Thu, 21 May 2015 14:41:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvVP1-0000R5-1A for emacs-orgmode@gnu.org; Thu, 21 May 2015 14:41:10 -0400 Received: from mail-qk0-f169.google.com ([209.85.220.169]:34842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvVP0-0000R1-TG for emacs-orgmode@gnu.org; Thu, 21 May 2015 14:41:06 -0400 Received: by qkdn188 with SMTP id n188so57992834qkd.2 for ; Thu, 21 May 2015 11:41:06 -0700 (PDT) In-Reply-To: <20150521181022.GC19311@chitra.no-ip.org> (Suvayu Ali's message of "Thu, 21 May 2015 20:10:22 +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: Suvayu Ali Cc: emacs-orgmode@gnu.org Suvayu Ali wrote: > On Thu, May 21, 2015 at 11:41:07AM -0400, Kyle Meyer wrote: [...] >> 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. Yes, I agree. It wasn't clear in my original message, but by "cleaner ways", I was referring to the implementation of org-notmuch-follow-link-other-window. I don't know if there's a better way to override switch-to-buffer. -- Kyle