unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH v2] emacs: add function to toggle display of all multipart/alternative parts
Date: Sun, 24 Jun 2012 19:56:09 +0100	[thread overview]
Message-ID: <8762agh73q.fsf@qmul.ac.uk> (raw)
In-Reply-To: <1340136889-2992-1-git-send-email-jani@nikula.org>


On Tue, 19 Jun 2012, Jani Nikula <jani@nikula.org> wrote:
> Add function notmuch-show-toggle-multipart-alternative to toggle the
> value of notmuch-show-all-multipart/alternative-parts variable in the
> buffer, and redisplay the thread with either all or preferred
> alternative parts expanded.
>
> A small wrinkle is that in order to make the variable survive
> notmuch-show-refresh-view (which is required for expanding/collapsing
> the parts, but ends up calling kill-all-local-variables through
> notmuch-show-mode) it is necessary to give it the permanent-local
> property.

Hi 

This patch looks good to me with one small concern: I set the
variable notmuch-show-all-multipart/alternative-parts in my an emacs file
loaded from my .emacs file rather than through customize using 
(setq notmuch-show-all-multipart/alternative-parts nil)

This no longer works because of the buffer local property (ie I see all
parts): I need to use 
(setq-default notmuch-show-all-multipart/alternative-parts nil)

This "change" might be worth flagging up in the news file.

I do not think the existence of my semi-patch
id:"87pq8vokmp.fsf@qmul.ac.uk" should hold up this patch. My patch is
only a draft and I definitely do not know enough lisp to be able to
write a correct version (with correct quoting of message-ids etc).

Best wishes

Mark



> ---
>  emacs/notmuch-show.el |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 36cad93..4d3f03f 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -98,6 +98,18 @@ any given message."
>    "Should all parts of multipart/alternative parts be shown?"
>    :type 'boolean
>    :group 'notmuch-show)
> +(make-variable-buffer-local 'notmuch-show-all-multipart/alternative-parts)
> +(put 'notmuch-show-all-multipart/alternative-parts 'permanent-local t)
> +
> +(defun notmuch-show-toggle-multipart-alternative ()
> +  "Toggle the display of all multipart/alternative parts."
> +  (interactive)
> +  (setq notmuch-show-all-multipart/alternative-parts
> +	(not notmuch-show-all-multipart/alternative-parts))
> +  (message (if notmuch-show-all-multipart/alternative-parts
> +	       "Showing all multipart/alternative parts."
> +	     "Showing preferred multipart/alternative part."))
> +  (notmuch-show-refresh-view))
>  
>  (defcustom notmuch-show-indent-messages-width 1
>    "Width of message indentation in threads.
> -- 
> 1.7.9.5
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

  parent reply	other threads:[~2012-06-24 18:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 15:55 [PATCH] emacs: add function to toggle display of all multipart/alternative parts Jani Nikula
2012-06-18 21:26 ` Jameson Graef Rollins
2012-06-19  6:56   ` Mark Walters
2012-08-09 20:52     ` Jameson Graef Rollins
2012-08-10  7:10       ` [PATCH v2] " Mark Walters
2012-08-10 14:53         ` Jani Nikula
2012-08-10 16:18           ` Jameson Graef Rollins
2012-08-10 16:39             ` Jani Nikula
2012-08-10 16:58               ` Mark Walters
2012-08-10 17:49                 ` Jameson Graef Rollins
2012-08-12 17:39         ` [PATCH 1/2] test: add emacs show mode test for toggling display of multipart/alternative Jameson Graef Rollins
2012-08-12 17:39           ` [PATCH 2/2] test: move all emacs show tests to emacs-show test script Jameson Graef Rollins
2012-08-31 19:44             ` David Bremner
2012-10-20  2:31           ` [PATCH 1/2] test: add emacs show mode test for toggling display of multipart/alternative Ethan Glasser-Camp
2012-10-09 22:21         ` [PATCH v2] emacs: add function to toggle display of all multipart/alternative parts Jeremy Nickurak
2012-10-19 16:36         ` Ethan Glasser-Camp
2012-06-19  6:57   ` [PATCH] " Jani Nikula
2012-06-19 20:14 ` [PATCH v2] " Jani Nikula
2012-06-19 20:25   ` Jani Nikula
2012-06-22 22:34   ` David Bremner
2012-06-24  7:10     ` Jani Nikula
2012-06-24 18:56   ` Mark Walters [this message]
2012-10-19 16:14     ` [PATCH] Add NEWS item for multipart/alternative toggle Ethan Glasser-Camp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8762agh73q.fsf@qmul.ac.uk \
    --to=markwalters1009@gmail.com \
    --cc=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).