From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MNE+Ace+J1+tHQAA0tVLHw (envelope-from ) for ; Mon, 03 Aug 2020 07:37:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ADCcOMa+J1+bUAAAB5/wlQ (envelope-from ) for ; Mon, 03 Aug 2020 07:37:42 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2CA7D940703 for ; Mon, 3 Aug 2020 07:37:41 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id EA83329A79; Mon, 3 Aug 2020 03:37:32 -0400 (EDT) Received: from meesny.iki.fi (unknown [IPv6:2001:67c:2b0:1c1::201]) by mail.notmuchmail.org (Postfix) with ESMTPS id 7CB7B28871 for ; Mon, 3 Aug 2020 03:37:29 -0400 (EDT) Received: from mithlond (mobile-access-6df022-134.dhcp.inet.fi [109.240.34.134]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: tlikonen) by meesny.iki.fi (Postfix) with ESMTPSA id 562D6202F9 for ; Mon, 3 Aug 2020 10:37:18 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1596440238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=p1+CA5FFKso8fn9lEJ1QAARyBWNrG4VhANBew/Lu1ro=; b=LkzOpn/CDHZ/d2nhh8bJ8sdFesytEhwO+wVvX8Zvr0C9kxUPs6nJO1A1/xHaMKpswsxnA9 QXIZTJm3VWLs9B1Oz3teXfMpItiPKqbe9MnjAWfB5n8e9qXR5RIG4XZhDPx+SsxZvz2ifv GHMSYo21ytOGBAWh87qgrhhEcCUHy4k= From: Teemu Likonen To: notmuch@notmuchmail.org Subject: Re: Message headers in right-to-left mode in Emacs notmuch-show-mode In-Reply-To: <87lfiwxnn4.fsf@iki.fi> References: <87lfiwxnn4.fsf@iki.fi> Date: Mon, 03 Aug 2020 10:37:11 +0300 Message-ID: <87ime0xjrs.fsf@iki.fi> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1596440238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=p1+CA5FFKso8fn9lEJ1QAARyBWNrG4VhANBew/Lu1ro=; b=Xu6/fPk9a4NU41CQCU9ULWGDd5Ke8sLWGnqRSPRgfniGJkBZUwYYftjKDAq645ijWrkFD9 /wkXpgRTrf5cIawhKKTMAplGsy1G+/D8HqqnGtZjkOEu94wmR5m0UpUgBUOsGlHZWF4ct9 ujpj/BT14R6WNCfmL4WqTIHahZX5s74= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1596440238; a=rsa-sha256; cv=none; b=sU0bRW1nMF0N9O4smkj098FGpaRjHz56E4OPylIj6bXfSENCWcwNyPHpgJ/n0GbWdG6F5o GtIS2Zfy8TXyND0VuqKSP563MeB+aAQtBdOa1jcjhlcfrujBXCQ8xaSj8qV4hSqe8ePX88 0KBENMIly+WnGARAxLuF/JQK2ajV+BY= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=tlikonen smtp.mailfrom=tlikonen@iki.fi Message-ID-Hash: QLLYTMYRU7O3BJW4SDBFB35M2A37KULJ X-Message-ID-Hash: QLLYTMYRU7O3BJW4SDBFB35M2A37KULJ X-MailFrom: tlikonen@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============3931939609824516416==" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=iki.fi header.s=meesny header.b=LkzOpn/C; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.43 X-TUID: WF9PaWjXcclz --===============3931939609824516416== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain * 2020-08-03 09:13:35+03, Teemu Likonen wrote: > I believe the header part can be switched to left-to-right mode by > using function bidi-string-mark-left-to-right. It seems that adding just a single U+200E LEFT-TO-RIGHT MARK character (possibly with invisible text property) in the beginning of message header paragraph will do. The attached (inline) patch does it. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Emacs-Force-left-to-right-display-for-message-header.patch Content-Transfer-Encoding: quoted-printable From=204264a1b3561c132343fe6a74e8cf2548e5127c3e 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. =2D-- 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 =2D-- 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))) =2D (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width= depth)) + (insert (propertize (string #x200e) 'invisible t) ; U+200E LEFT-TO-RIG= HT MARK + (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth)) (notmuch-sanitize (notmuch-show-clean-address (plist-get headers :From))) " (" =2D-=20 2.20.1 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 /// Teemu Likonen - .-.. http://www.iki.fi/tlikonen/ // OpenPGP: 4E1055DC84E9DFF613D78557719D69D324539450 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYIAC4WIQTJW2wqtelxC1gHdbitnXWr7pTCcwUCXye+pxAcdGxpa29uZW5A aWtpLmZpAAoJEK2ddavulMJzyAYBAIq3yzyFb1qSnvd+hupXdbYXnBtvUETh+Vih 2LhF+Bw1AP9Nelca90yadCQ21hgxoq7ZarsqDIrbhWEydxz6zoxlAw== =RBsE -----END PGP SIGNATURE----- --==-=-=-- --===============3931939609824516416== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============3931939609824516416==--