Re: [PATCH v5] Emacs: Ensure left-to-right display for message headers

Subject: Re: [PATCH v5] Emacs: Ensure left-to-right display for message headers

Date: Mon, 10 Aug 2020 19:45:11 +0300

To: tomi.ollila@iki.fi, notmuch@notmuchmail.org

Cc:

From: Teemu Likonen


* 2020-08-09 23:12:28+03, utf wrote:

> How about this =D

> From: contains U+202E (LEFT-TO-RIGHT OVERRIDE) (in
> =?utf-8?Q?T=E2=80=AEomi?=)

Indeed message's header fields can contain such override characters. The
override mode should be terminated with U+202C POP DIRECTIONAL
FORMATTING within the same header field. That POP character pops the
override mode from the direction mode stack and returns to the previous
mode. Those characters can mess any text badly when not used in
controlled pairs of "push" and "pop".

I'll write "abc abc abc" series but the middle "abc" have RIGHT-TO-LEFT
OVERRIDE before "a" and POP DIRECTIONAL FORMATTING after "c". In Emacs
try using C-f and C-b commands to move the cursor above the text:

    abc ‮abc‬ abc

If we wanted to clean message headers from possible unpaired overrides
we should clean all these:

    U+202A LEFT-TO-RIGHT EMBEDDING (push)
    U+202B RIGHT-TO-LEFT EMBEDDING (push)
    U+202C POP DIRECTIONAL FORMATTING (pop)
    U+202D LEFT-TO-RIGHT OVERRIDE (push)
    U+202E RIGHT-TO-LEFT OVERRIDE (push)

Or we could even try to be clever and count those characters and then
insert or remove some of them so that there are as many "push"
characters as "pop" characters.

-- 
/// Teemu Likonen - .-.. http://www.iki.fi/tlikonen/
// OpenPGP: 4E1055DC84E9DFF613D78557719D69D324539450
signature.asc (application/pgp-signature)
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: