From 4a6a450c9f8dbe33258b63399824734b6b37d38a Mon Sep 17 00:00:00 2001 From: David Edmondson Date: Thu, 22 May 2014 09:22:42 +0100 Subject: [PATCH] Re: [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility', bound to '>' --- 3b/7c3098a56150cf80f5be1ac2ec901b42ef094b | 162 ++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 3b/7c3098a56150cf80f5be1ac2ec901b42ef094b diff --git a/3b/7c3098a56150cf80f5be1ac2ec901b42ef094b b/3b/7c3098a56150cf80f5be1ac2ec901b42ef094b new file mode 100644 index 000000000..81e4159b6 --- /dev/null +++ b/3b/7c3098a56150cf80f5be1ac2ec901b42ef094b @@ -0,0 +1,162 @@ +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 96A0B431FBC + for ; Thu, 22 May 2014 01:22:56 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 Q8b606-L-Wsj for ; + Thu, 22 May 2014 01:22:52 -0700 (PDT) +Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com + [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 5FF2F431FAE + for ; Thu, 22 May 2014 01:22:52 -0700 (PDT) +Received: by mail-wi0-f178.google.com with SMTP id cc10so3912966wib.5 + for ; Thu, 22 May 2014 01:22:51 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:to:subject:in-reply-to:references:user-agent + :from:date:message-id:mime-version:content-type; + bh=ix+DpXvbHk1xJf9+EYW7VeAP+QHf+Rw0+WACHGf08rE=; + b=iZBSrgu+HoDprm859UfCjhM0AypSVZ1VhIeHSLiQkKHZXfMc6k34tMuVqTCU5+JbmH + 5ZGhQyjh7Ozn+UMB2mEcCxhLL40yKWRaPb/HuxF0c3DVU+mFFjLVqeecLpktsnkyMMlN + Rhgvz6kD13TpX2fp4oq+CBfvw5rTEoRw+GK/ZQUaXF4UFDebG5ZmwWp6285wvl3XkuTD + H9NoO/OlZIIIyjhKIUBcBCHHH12rymdaQoM1YmqJoqImZs9W7U/kSsmR9DKYhjXWi84c + en2sp7s9b86KqU/ssdtg1j+St1Eudtpp/l8Fde9qZ//LtWLM4BMMgdvGRj6s0qLQNQNI + 7Crg== +X-Gm-Message-State: + ALoCoQkp9ByUZle0fOWNz1rrUKz2mTZxmZc0gy5+HAbgsv1mRe3TFlgm3Haj5Xp4/cx2M/02ZMLz +X-Received: by 10.180.93.163 with SMTP id cv3mr15177751wib.3.1400746971103; + Thu, 22 May 2014 01:22:51 -0700 (PDT) +Received: from localhost ([2a01:348:1a2:1:a288:b4ff:fe8a:77d8]) + by mx.google.com with ESMTPSA id lz11sm6684696wic.0.2014.05.22.01.22.49 + for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 22 May 2014 01:22:50 -0700 (PDT) +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility', + bound to '>' +In-Reply-To: <87zjia6ykb.fsf@qmul.ac.uk> +References: <1400601369-17005-1-git-send-email-dme@dme.org> + <87zjia6ykb.fsf@qmul.ac.uk> +User-Agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +From: David Edmondson +Date: Thu, 22 May 2014 09:22:42 +0100 +Message-ID: +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha1; protocol="application/pgp-signature" +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: Thu, 22 May 2014 08:22:56 -0000 + +--=-=-= +Content-Type: text/plain +Content-Transfer-Encoding: quoted-printable + +On Thu, May 22 2014, Mark Walters wrote: +> On Tue, 20 May 2014, David Edmondson wrote: +>> Add a function and key-binding to toggle the collapsing of citations +>> within the current message. +> +> Hi=20 +> +> I like the idea. It seems a little odd to want to toggle the citations +> closing some and opening others. I wonder whether the following action +> would be more intuitive. + +Toggle is a side-effect of the implementation, I agree. + +> If any citation is closed then open all citations. Otherwise close all +> citations. +> +> Alternatively, we could mirror things like M-RET and have ">" always opens +> citations and PREFIX ">" always closes all citations. +> +> What do you think? + +I'll do this. (Busy next week, so it won't be immediate.) + +> Best wishes +> +> Mark +> +>> --- +>> emacs/notmuch-show.el | 17 +++++++++++++++++ +>> 1 file changed, 17 insertions(+) +>> +>> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +>> index 10fc872..e4b56c7 100644 +>> --- a/emacs/notmuch-show.el +>> +++ b/emacs/notmuch-show.el +>> @@ -1036,6 +1036,22 @@ useful for quoting in replies)." +>> "Content is not indented.")) +>> (notmuch-show-refresh-view)) +>>=20=20 +>> +(defun notmuch-show-toggle-citation-visibility () +>> + "Toggle the visibility of the citations in the current message." +>> + (interactive) +>> + (let ((beg (notmuch-show-message-top)) +>> + (end (notmuch-show-message-bottom)) +>> + button) +>> + (save-excursion +>> + (goto-char beg) +>> + (while (and (setq button (next-button (point))) +>> + (< (goto-char (button-start button)) +>> + end)) +>> + (let ((overlay (button-get button 'overlay))) +>> + (when (and overlay +>> + (string=3D (overlay-get overlay 'type) "citation")) +>> + (push-button (point)))))))) +>> + +>> (defun notmuch-show-insert-tree (tree depth) +>> "Insert the message tree TREE at depth DEPTH in the current thread." +>> (let ((msg (car tree)) +>> @@ -1311,6 +1327,7 @@ reset based on the original query." +>> (define-key map "!" 'notmuch-show-toggle-elide-non-matching) +>> (define-key map "$" 'notmuch-show-toggle-process-crypto) +>> (define-key map "<" 'notmuch-show-toggle-thread-indentation) +>> + (define-key map ">" 'notmuch-show-toggle-citation-visibility) +>> (define-key map "t" 'toggle-truncate-lines) +>> (define-key map "." 'notmuch-show-part-map) +>> map) +>> --=20 +>> 2.0.0.rc0 +>> +>> _______________________________________________ +>> notmuch mailing list +>> notmuch@notmuchmail.org +>> http://notmuchmail.org/mailman/listinfo/notmuch + +--=-=-= +Content-Type: application/pgp-signature; name="signature.asc" + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iKYEARECAGYFAlN9s9JfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl +bnBncC5maWZ0aGhvcnNlbWFuLm5ldDc1M0Y5NDJDMEExNjc3MDE4OURGMUYyMDY5 +RUNEMEFCRjA0OTY1MTYACgkQaezQq/BJZRYjIgCfcx3ILftPcox93VjphcCEIpAv +7VYAnibJSTGVkd1wBDfpmXCHfkhPt6YL +=Qce1 +-----END PGP SIGNATURE----- +--=-=-=-- -- 2.26.2