From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 9BCFB431E84 for ; Tue, 24 Jan 2012 22:35:40 -0800 (PST) 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 5U4TETtJOHiL for ; Tue, 24 Jan 2012 22:35:38 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 54A45431FB6 for ; Tue, 24 Jan 2012 22:35:38 -0800 (PST) Received: by werb10 with SMTP id b10so4131238wer.26 for ; Tue, 24 Jan 2012 22:35:37 -0800 (PST) Received: by 10.216.133.29 with SMTP id p29mr6518400wei.49.1327473337018; Tue, 24 Jan 2012 22:35:37 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id m8sm39153733wia.11.2012.01.24.22.35.35 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jan 2012 22:35:35 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id A77B69FD47; Wed, 25 Jan 2012 06:35:33 +0000 (GMT) To: Pieter Praet , Notmuch Mail Subject: Re: [PATCH] emacs: make `notmuch-show-open-or-close-all' toggle visibility In-Reply-To: <1327469139-1968-1-git-send-email-pieter@praet.org> References: <1327469139-1968-1-git-send-email-pieter@praet.org> User-Agent: Notmuch/0.11+105~g08b3b0f (http://notmuchmail.org) Emacs/24.0.92.1 (x86_64-pc-linux-gnu) From: David Edmondson Date: Wed, 25 Jan 2012 06:35:33 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Gm-Message-State: ALoCoQlmxSwSucFsY45DVndUHqFJT1zlFxKKpAucd4tyGFLA/vONDrLanI4bP5YCPAmet+Fzdd79 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, 25 Jan 2012 06:35:40 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 25 Jan 2012 06:25:39 +0100, Pieter Praet wrote: > * emacs/notmuch-show.el (notmuch-show-open-or-close-all): > Rename to `notmuch-show-toggle-all-messages', and make it toggle > visibility of all messages based on the visibility of the current > message, instead of setting visibility based on whether or not a > prefix arg was supplied. >=20 > Same functionality, less effort (reaching for 'C-u' is a pain)... =2D1. The behaviour you've provided is not what I want, from two perspectives: - currently it's clear what will happen when I use M-RET or C-uM-RET without me having to think about whether the cursor is over an open message, - often I'll be reading an open message and I want to open all of the rest to look at some context. That's a little more awkward after this change. >=20 > --- > emacs/notmuch-show.el | 22 ++++++++++++---------- > 1 files changed, 12 insertions(+), 10 deletions(-) >=20 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index e6a5b31..2d17f74 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -1050,8 +1050,8 @@ thread id. If a prefix is given, crypto processing= is toggled." > (define-key map "p" 'notmuch-show-previous-open-message) > (define-key map (kbd "DEL") 'notmuch-show-rewind) > (define-key map " " 'notmuch-show-advance-and-archive) > - (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all) > (define-key map (kbd "RET") 'notmuch-show-toggle-message) > + (define-key map (kbd "M-RET") 'notmuch-show-toggle-all-messages) > (define-key map "#" 'notmuch-show-print-message) > map) > "Keymap for \"notmuch show\" buffers.") > @@ -1502,16 +1502,18 @@ the result." > (not (plist-get props :message-visible)))) > (force-window-update)) >=20=20 > -(defun notmuch-show-open-or-close-all () > - "Set the visibility all of the messages in the current thread. > -By default make all of the messages visible. With a prefix > -argument, hide all of the messages." > +(defun notmuch-show-toggle-all-messages () > + "Toggle the visibility of all messages in the current thread. > +If the current message is visible, hide all messages -- and vice versa." > (interactive) > - (save-excursion > - (goto-char (point-min)) > - (loop do (notmuch-show-message-visible (notmuch-show-get-message-pro= perties) > - (not current-prefix-arg)) > - until (not (notmuch-show-goto-message-next)))) > + (let ((toggle (notmuch-show-message-visible-p))) > + (save-excursion > + (goto-char (point-min)) > + (loop do (notmuch-show-message-visible > + (notmuch-show-get-message-properties) > + (not toggle)) > + until (not (notmuch-show-goto-message-next))))) > + (recenter-top-bottom 1) > (force-window-update)) >=20=20 > (defun notmuch-show-next-button () > --=20 > 1.7.8.1 >=20 > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8forUACgkQaezQq/BJZRY4EQCfQ5oPOeJnXidE2yuPAGqVXtWv I4cAn2chJfpZrK/NolUMkHcttW6EHyfx =eyO+ -----END PGP SIGNATURE----- --=-=-=--