Re: [PATCH] emacs: show: make id links respect window
[notmuch-archives.git] / 0a / b2b35c435b9ab45d51160e387ae4f95d2fe875
diff --git a/0a/b2b35c435b9ab45d51160e387ae4f95d2fe875 b/0a/b2b35c435b9ab45d51160e387ae4f95d2fe875
new file mode 100644 (file)
index 0000000..b133242
--- /dev/null
@@ -0,0 +1,140 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 6C1BA431FBF\r
+       for <notmuch@notmuchmail.org>; Sun,  6 Jan 2013 07:56:35 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 7BvJrCHMjF0Y for <notmuch@notmuchmail.org>;\r
+       Sun,  6 Jan 2013 07:56:31 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 56896431FAF\r
+       for <notmuch@notmuchmail.org>; Sun,  6 Jan 2013 07:56:31 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 7862A1000D0;\r
+       Sun,  6 Jan 2013 17:56:23 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Mark Walters <markwalters1009@gmail.com>,\r
+ David Bremner <david@tethera.net>,    notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: show: make id links respect window\r
+In-Reply-To: <87k3rqz594.fsf@qmul.ac.uk>\r
+References: <1355958602-16752-1-git-send-email-markwalters1009@gmail.com>\r
+       <87bodjfnt0.fsf@zancas.localnet> <87mwx2jsu0.fsf@qmul.ac.uk>\r
+       <87bodgrh6a.fsf@zancas.localnet>\r
+       <m2zk0ni9jg.fsf@guru.guru-group.fi> <87k3rqz594.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.14+236~ge6d0259 (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Sun, 06 Jan 2013 17:56:23 +0200\r
+Message-ID: <m2txqufgpk.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 06 Jan 2013 15:56:35 -0000\r
+\r
+On Sun, Jan 06 2013, Mark Walters <markwalters1009@gmail.com> wrote:\r
+\r
+> On Sat, 05 Jan 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+>> On Wed, Dec 26 2012, David Bremner <david@tethera.net> wrote:\r
+>>\r
+>>> Mark Walters <markwalters1009@gmail.com> writes:\r
+>>>\r
+>>>>> I can imagine that people would want/like the "open in other window" \r
+>>>>> effect of the current code, even if the reason is a bug.\r
+>>>>\r
+>>>> That's definitely possible. I generally expect a mouse click to select\r
+>>>> the window I click and this feels counter intuitive. I think that some\r
+>>>> people might like an option "open this link in a new window" but I would\r
+>>>> guess that would like that whether they clicked or pressed RET on the\r
+>>>> button.\r
+>>>\r
+>>> I don't care much either way myself, but before we change notmuch-show\r
+>>> behaviour (effectively) to accomodate notmuch-pick, I'd like a bit more\r
+>>> feedback from other people.\r
+>>\r
+>> I tested the old behaviour -- split frame to 2 windows, one containing\r
+>> *scratch* and one *notmuch-hello*. Then I searched for 'obsoletes',\r
+>> chose last message (id:1356936162-2589-1-git-send-email-amdragon@mit.edu)\r
+>> moved point to *scratch* buffer and clicked the id: link -- and indeed,\r
+>> the *scratch* window was replaced.\r
+>>\r
+>> I didn't look or test Mark's patch as he stated:\r
+>> "The lisp is not pretty but seems to work." ;)\r
+>> ... well, not entirely because of that but I trust it opens the message\r
+>> in window where the clicked link were and keeps point where it used to\r
+>> be before clicking (in case point was in different window).\r
+>\r
+> It doesn't quite do this: point moves to the window that was clicked. It\r
+> is just as easy to do as Tomi says (patch below but I should resend if\r
+> people like it so the commit message gets picked up).\r
+\r
+It seems to be the default (and iniuitively expected) behaviour that\r
+point moves to the window that was clicked... so that's ok :)\r
+\r
+> Incidentally, I would be interested to know what people expect the\r
+> following to do: go to notmuch hello and then search. Now display the\r
+> results in two windows simultaneously (either split the frame into two\r
+> windows (c-x 2) or use 2 frames (C-x 5 2)) and then press q.\r
+>\r
+> What actually happens is that q runs kill buffer so it disappears in\r
+> both windows: one of which will fall back to notmuch-hello and one of\r
+> which will fall back to some other window (eg scratch)\r
+\r
+I think that is just expected behaviour, there are e.g.. c-x b and c-x 0\r
+which should be familiar to every emacs users...\r
+\r
+> Best wishes\r
+>\r
+> Mark\r
+\r
+Tomi\r
+\r
+PS: did you change anything in the patch below ?\r
+\r
+>\r
+>  emacs/notmuch-show.el |    5 +++++\r
+>  1 files changed, 5 insertions(+), 0 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 5751d98..00b9b56 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -1077,6 +1077,11 @@ buttons for a corresponding notmuch search."\r
+>      (make-text-button (first link) (second link)\r
+>                        'action `(lambda (arg)\r
+>                                   (notmuch-show ,(third link)))\r
+> +                      'mouse-action `(lambda (arg)\r
+> +                                       (let* ((event last-input-event)\r
+> +                                              (window (car (cadr event))))\r
+> +                                         (with-selected-window window\r
+> +                                           (notmuch-show ,(third link)))))\r
+>                        'follow-link t\r
+>                        'help-echo "Mouse-1, RET: search for this message"\r
+>                        'face goto-address-mail-face)))))\r
+> -- \r
+> 1.7.9.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r