[PATCH] emacs: escape % in header line format

Jinwoo Lee jinwoo68 at gmail.com
Thu Jan 22 09:49:05 PST 2015


Yup.  It works!  Thanks for the quick fix.  Is this going to be merged
to HEAD soon?

-jinwoo

On Thu, Jan 22, 2015 at 12:37 AM, David Bremner <david at tethera.net> wrote:
> We set header-line-format to the message subject, but if the subject
> contains percents, the next character is interpreted as a formatting
> control, which is not desired.
> ---
>
> You're correct of course. I have no idea how my testing convinced me
> the previous version worked.
>
> emacs/notmuch-show.el | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 9f6fe07..87b4881 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -1198,7 +1198,11 @@ function is used."
>        (notmuch-show-mapc (lambda () (notmuch-show-set-prop :orig-tags (notmuch-show-get-tags))))
>  
>        ;; Set the header line to the subject of the first message.
> -      (setq header-line-format (notmuch-sanitize (notmuch-show-strip-re (notmuch-show-get-subject))))
> +      (setq header-line-format
> +	    (replace-regexp-in-string "%" "%%"
> +			    (notmuch-sanitize
> +			     (notmuch-show-strip-re
> +			      (notmuch-show-get-subject)))))
>  
>        (run-hooks 'notmuch-show-hook))))
>  
> -- 
> 2.1.4


More information about the notmuch mailing list