From d3145b6bcc6af115a73ef6277c7a57a53f2b7978 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Wed, 19 Dec 2012 23:10:02 +0000 Subject: [PATCH] [PATCH] emacs: show: make id links respect window --- c5/020460b5d76a116ae5a4dd6ee6adc3ae53a5b0 | 104 ++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 c5/020460b5d76a116ae5a4dd6ee6adc3ae53a5b0 diff --git a/c5/020460b5d76a116ae5a4dd6ee6adc3ae53a5b0 b/c5/020460b5d76a116ae5a4dd6ee6adc3ae53a5b0 new file mode 100644 index 000000000..72f841929 --- /dev/null +++ b/c5/020460b5d76a116ae5a4dd6ee6adc3ae53a5b0 @@ -0,0 +1,104 @@ +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 EAD56431FAF + for ; Wed, 19 Dec 2012 15:10:16 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] 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 HGUVbRNsF0yH for ; + Wed, 19 Dec 2012 15:10:16 -0800 (PST) +Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com + [74.125.82.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 5908D431FAE for ; Wed, 19 Dec 2012 15:10:16 -0800 + (PST) +Received: by mail-wg0-f52.google.com with SMTP id 12so1201746wgh.31 + for ; Wed, 19 Dec 2012 15:10:15 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=x-received:from:to:cc:subject:date:message-id:x-mailer; + bh=L8xG0c+kyR2Q4x4KIUN6/ACvOugozyUScsrwUcmvqRs=; + b=wUBgYPLqzBNBDDI4svJbTLRKmp6I4MfrPWlUWlW/5QKk2Rz61+sWZTtJp8T5JKLT64 + u51qoWUDVBARADkmsHjf6tjBVSWXjHyLvisYkwO0is3/9OqtF7X3DMfBddSLptlucjLv + TQS463qm5l+NxAsupAudwt1JvHPlHPy0cP/+cOcRyKIGFHDDPQyOXTBbTSzpa8NtNNOO + vrSdLUVCxJh5aS2IkLiGe28UTpEBWtni9I2CeO/spWVK2kDmTanQJbYYzR5CpUZycrQh + YLQexKPaJlP1P/09HQggY2qd0tEvgaT0NC60Aw7lLO2oAXE4Q3sMD4uMJNHoF1ggHnix + EtIw== +X-Received: by 10.180.78.226 with SMTP id e2mr12356636wix.1.1355958613855; + Wed, 19 Dec 2012 15:10:13 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPS id i2sm22694607wiw.3.2012.12.19.15.10.11 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 19 Dec 2012 15:10:12 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: show: make id links respect window +Date: Wed, 19 Dec 2012 23:10:02 +0000 +Message-Id: <1355958602-16752-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +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: Wed, 19 Dec 2012 23:10:17 -0000 + +There is a bug in current notmuch: if you have multiple windows in one +frame and click an id button link in a show buffer that does not +contain point then the link is opened in the window containing point. + +This reads the mouse event to make sure that the correct window is +used for the link. +--- + +I think this is a bug but that could be debated. It is particularly +easy to trigger with notmuch pick because that uses the split pane +while focus usually remains in the `pick' pane rather than the `show' +pane. + +The lisp is not pretty but seems to work. + +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..5664ea3 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)))) ++ (select-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