From: Mark Walters Date: Thu, 22 May 2014 07:51:32 +0000 (+0100) Subject: Re: [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility', bound to '>' X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d53120fa4b49373e4ca296041b18a5c607da5c04;p=notmuch-archives.git Re: [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility', bound to '>' --- diff --git a/45/01907635886bff8d09ec34ceabeec7472dcac9 b/45/01907635886bff8d09ec34ceabeec7472dcac9 new file mode 100644 index 000000000..2e7c90efc --- /dev/null +++ b/45/01907635886bff8d09ec34ceabeec7472dcac9 @@ -0,0 +1,136 @@ +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 1DA0B431FBC + for ; Thu, 22 May 2014 00:51:46 -0700 (PDT) +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 6b04CxIYJIHu for ; + Thu, 22 May 2014 00:51:38 -0700 (PDT) +Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com + [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 4B337431FAE for ; Thu, 22 May 2014 00:51:38 -0700 + (PDT) +Received: by mail-wg0-f45.google.com with SMTP id m15so2967105wgh.4 + for ; Thu, 22 May 2014 00:51:34 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type; + bh=eOh2QxE6OSv/EmYS0G0LK77qfwtjKIIi/NaEzlNt2aU=; + b=veXQlvz47RzYa8PUSYiYALOj6Zq3StXG5v1wfBRKs6P+PD/9tNNqbyiuya7kSX0pbY + BEcEE7wspHfabTTmHpl4tzW4f7rHDUA0Ni3y+A1O6d5HtQniaG+Vu89pLK9SWriDHq7y + e5bc5UMYthaq2vPSLFk8VzzqsKN54rOmKhL8/i+m9fcuUHBnhy9TtTUFklXTBGorcvLw + ZpK2uAx3JfLZNp6RFwi29mHE5bH/AHqI62Nf1iBHsQuJ3XCSE/NExG1arfdSD0/xsxjq + Gl1lv/xdJBH+J526n2mxJoeegrs5yrfPlEARXCb3NPjSt/THcHKLFAX6uJfJXU/1lXI+ + Gz9Q== +X-Received: by 10.194.58.79 with SMTP id o15mr1163280wjq.62.1400745094766; + Thu, 22 May 2014 00:51:34 -0700 (PDT) +Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) + by mx.google.com with ESMTPSA id dz5sm6530796wib.22.2014.05.22.00.51.33 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Thu, 22 May 2014 00:51:33 -0700 (PDT) +From: Mark Walters +To: David Edmondson , notmuch@notmuchmail.org +Subject: Re: [PATCH v1] emacs: Add `notmuch-show-toggle-citation-visibility', + bound to '>' +In-Reply-To: <1400601369-17005-1-git-send-email-dme@dme.org> +References: <1400601369-17005-1-git-send-email-dme@dme.org> +User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Thu, 22 May 2014 08:51:32 +0100 +Message-ID: <87zjia6ykb.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +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 07:51:46 -0000 + +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 + +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. + +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? + +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)) +> +> +(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= (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) +> -- +> 2.0.0.rc0 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch