From b49bbf49e49aadad313deac7c40f6d5b9ca15163 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sun, 6 Jan 2013 15:43:35 +0000 Subject: [PATCH] Re: [PATCH] emacs: show: make id links respect window --- dc/8a1259c7bef21d567f4fa043f12e396f3e07ce | 146 ++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 dc/8a1259c7bef21d567f4fa043f12e396f3e07ce diff --git a/dc/8a1259c7bef21d567f4fa043f12e396f3e07ce b/dc/8a1259c7bef21d567f4fa043f12e396f3e07ce new file mode 100644 index 000000000..e0dc74b9e --- /dev/null +++ b/dc/8a1259c7bef21d567f4fa043f12e396f3e07ce @@ -0,0 +1,146 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id AC07B431FAF + for ; Sun, 6 Jan 2013 07:43:41 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id hGEIwkuMZLTk for ; + Sun, 6 Jan 2013 07:43:40 -0800 (PST) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 2130D431FAE + for ; Sun, 6 Jan 2013 07:43:40 -0800 (PST) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1TrsNo-0001Ae-Jk; Sun, 06 Jan 2013 15:43:33 +0000 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) + (envelope-from ) + id 1TrsNo-0005zL-9d; Sun, 06 Jan 2013 15:43:32 +0000 +From: Mark Walters +To: Tomi Ollila , David Bremner , + notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: show: make id links respect window +In-Reply-To: +References: <1355958602-16752-1-git-send-email-markwalters1009@gmail.com> + <87bodjfnt0.fsf@zancas.localnet> <87mwx2jsu0.fsf@qmul.ac.uk> + <87bodgrh6a.fsf@zancas.localnet> + +User-Agent: Notmuch/0.14+236~g1d0044f (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Sun, 06 Jan 2013 15:43:35 +0000 +Message-ID: <87k3rqz594.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 98603f3e42f2273d9f40b14ec3035a33 (of first 20000 bytes) +X-SpamAssassin-Score: -1.8 +X-SpamAssassin-SpamBar: - +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -1.8 points. + Summary of the scoring: + * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, + * medium trust + * [138.37.6.40 listed in list.dnswl.org] + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.5 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 06 Jan 2013 15:43:41 -0000 + + +On Sat, 05 Jan 2013, Tomi Ollila wrote: +> On Wed, Dec 26 2012, David Bremner wrote: +> +>> Mark Walters writes: +>> +>>>> I can imagine that people would want/like the "open in other window" +>>>> effect of the current code, even if the reason is a bug. +>>> +>>> That's definitely possible. I generally expect a mouse click to select +>>> the window I click and this feels counter intuitive. I think that some +>>> people might like an option "open this link in a new window" but I would +>>> guess that would like that whether they clicked or pressed RET on the +>>> button. +>> +>> I don't care much either way myself, but before we change notmuch-show +>> behaviour (effectively) to accomodate notmuch-pick, I'd like a bit more +>> feedback from other people. +> +> I tested the old behaviour -- split frame to 2 windows, one containing +> *scratch* and one *notmuch-hello*. Then I searched for 'obsoletes', +> chose last message (id:1356936162-2589-1-git-send-email-amdragon@mit.edu) +> moved point to *scratch* buffer and clicked the id: link -- and indeed, +> the *scratch* window was replaced. +> +> I didn't look or test Mark's patch as he stated: +> "The lisp is not pretty but seems to work." ;) +> ... well, not entirely because of that but I trust it opens the message +> in window where the clicked link were and keeps point where it used to +> be before clicking (in case point was in different window). + +It doesn't quite do this: point moves to the window that was clicked. It +is just as easy to do as Tomi says (patch below but I should resend if +people like it so the commit message gets picked up). + +Incidentally, I would be interested to know what people expect the +following to do: go to notmuch hello and then search. Now display the +results in two windows simultaneously (either split the frame into two +windows (c-x 2) or use 2 frames (C-x 5 2)) and then press q. + +What actually happens is that q runs kill buffer so it disappears in +both windows: one of which will fall back to notmuch-hello and one of +which will fall back to some other window (eg scratch) + +Best wishes + +Mark + + emacs/notmuch-show.el | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index 5751d98..00b9b56 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -1077,6 +1077,11 @@ buttons for a corresponding notmuch search." + (make-text-button (first link) (second link) + 'action `(lambda (arg) + (notmuch-show ,(third link))) ++ 'mouse-action `(lambda (arg) ++ (let* ((event last-input-event) ++ (window (car (cadr event)))) ++ (with-selected-window window ++ (notmuch-show ,(third link))))) + 'follow-link t + 'help-echo "Mouse-1, RET: search for this message" + 'face goto-address-mail-face))))) +-- +1.7.9.1 + -- 2.26.2