From 4264a1b3561c132343fe6a74e8cf2548e5127c3e Mon Sep 17 00:00:00 2001 From: Teemu Likonen Date: Mon, 3 Aug 2020 10:25:27 +0300 Subject: [PATCH] Emacs: Force left-to-right display for message headers Insert U+200E LEFT-TO-RIGHT MARK at the beginning of message headers. It forces message headers to display as left-to-right text even if there are strong directional characters in header's values. See Emacs Lisp reference manual section "(elisp) Bidirectional Display" for more info. --- emacs/notmuch-show.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index c9170466..87f68bc8 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -467,7 +467,8 @@ unchanged ADDRESS if parsing fails." "Insert a notmuch style headerline based on HEADERS for a message at DEPTH in the current thread." (let ((start (point))) - (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth)) + (insert (propertize (string #x200e) 'invisible t) ; U+200E LEFT-TO-RIGHT MARK + (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth)) (notmuch-sanitize (notmuch-show-clean-address (plist-get headers :From))) " (" -- 2.20.1