unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Percent symbol is not shown in the global subject line in the Emacs notmuch-show buffer
@ 2015-01-22  2:28 Jinwoo Lee
  2015-01-22  7:18 ` [PATCH] emacs: escape % in header line format David Bremner
  0 siblings, 1 reply; 7+ messages in thread
From: Jinwoo Lee @ 2015-01-22  2:28 UTC (permalink / raw)
  To: notmuch

When reading an email thread with Emacs client of notmuch, there are two
places where the email subject is displayed -- one at the top of the
buffer, and per each email in the thread.

When the subject contains '%' in it, the global subject line at the top
of the buffer doesn't show it and the subject looks weird.  Say I have
an email with subject "100% increase in latency", the top line will say
"100increase in latency".  Note that the space after the '%' symbol is
also removed.  The subject line per email shows it fine.

Can this be fixed?  I'm very annoyed by this :)

Thanks,
-jinwoo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] emacs: escape % in header line format
  2015-01-22  2:28 Percent symbol is not shown in the global subject line in the Emacs notmuch-show buffer Jinwoo Lee
@ 2015-01-22  7:18 ` David Bremner
  2015-01-22  8:15   ` Jinwoo Lee
  0 siblings, 1 reply; 7+ messages in thread
From: David Bremner @ 2015-01-22  7:18 UTC (permalink / raw)
  To: Jinwoo Lee, notmuch

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.
---

Ironically you have to apply this patch to read it's subject properly
;).  There is whitespace change here because the original line was way
too long.

 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..4258d43 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-string "%" "%%"
+			    (notmuch-sanitize
+			     (notmuch-show-strip-re
+			      (notmuch-show-get-subject)))))
 
       (run-hooks 'notmuch-show-hook))))
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] emacs: escape % in header line format
  2015-01-22  7:18 ` [PATCH] emacs: escape % in header line format David Bremner
@ 2015-01-22  8:15   ` Jinwoo Lee
  2015-01-22  8:37     ` David Bremner
  0 siblings, 1 reply; 7+ messages in thread
From: Jinwoo Lee @ 2015-01-22  8:15 UTC (permalink / raw)
  To: David Bremner, notmuch

Thanks, David.  But I don't think it's the correct fix.  REPLACE-STRING
seems to replace a string in a buffer, not a string given as a param.
And it's for interactive use only.

-jinwoo

On Wed, Jan 21, 2015 at 11:18 PM, David Bremner <david@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.
> ---
>
> Ironically you have to apply this patch to read it's subject properly
> ;).  There is whitespace change here because the original line was way
> too long.
>
>  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..4258d43 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-string "%" "%%"
> +			    (notmuch-sanitize
> +			     (notmuch-show-strip-re
> +			      (notmuch-show-get-subject)))))
>  
>        (run-hooks 'notmuch-show-hook))))
>  
> -- 
> 2.1.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] emacs: escape % in header line format
  2015-01-22  8:15   ` Jinwoo Lee
@ 2015-01-22  8:37     ` David Bremner
  2015-01-22 17:49       ` Jinwoo Lee
  0 siblings, 1 reply; 7+ messages in thread
From: David Bremner @ 2015-01-22  8:37 UTC (permalink / raw)
  To: Jinwoo Lee, David Bremner, notmuch

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] emacs: escape % in header line format
  2015-01-22  8:37     ` David Bremner
@ 2015-01-22 17:49       ` Jinwoo Lee
  2015-01-22 19:42         ` David Bremner
  0 siblings, 1 reply; 7+ messages in thread
From: Jinwoo Lee @ 2015-01-22 17:49 UTC (permalink / raw)
  To: David Bremner, David Bremner, notmuch

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@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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] emacs: escape % in header line format
  2015-01-22 17:49       ` Jinwoo Lee
@ 2015-01-22 19:42         ` David Bremner
  2015-01-24  8:44           ` David Bremner
  0 siblings, 1 reply; 7+ messages in thread
From: David Bremner @ 2015-01-22 19:42 UTC (permalink / raw)
  To: Jinwoo Lee, notmuch

Jinwoo Lee <jinwoo68@gmail.com> writes:

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

Probably in the next day or so, unless somebody complains.

d

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] emacs: escape % in header line format
  2015-01-22 19:42         ` David Bremner
@ 2015-01-24  8:44           ` David Bremner
  0 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2015-01-24  8:44 UTC (permalink / raw)
  To: Jinwoo Lee, notmuch

David Bremner <david@tethera.net> writes:

> Jinwoo Lee <jinwoo68@gmail.com> writes:
>
>> Yup.  It works!  Thanks for the quick fix.  Is this going to be merged
>> to HEAD soon?
>>
>
> Probably in the next day or so, unless somebody complains.

This bug should be fixed in commit cc3d25d

d

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-24  8:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-22  2:28 Percent symbol is not shown in the global subject line in the Emacs notmuch-show buffer Jinwoo Lee
2015-01-22  7:18 ` [PATCH] emacs: escape % in header line format David Bremner
2015-01-22  8:15   ` Jinwoo Lee
2015-01-22  8:37     ` David Bremner
2015-01-22 17:49       ` Jinwoo Lee
2015-01-22 19:42         ` David Bremner
2015-01-24  8:44           ` David Bremner

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).