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 YD3RHbB5MV8DBAAA0tVLHw (envelope-from ) for ; Mon, 10 Aug 2020 16:45:36 +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 CAGwGbB5MV9eQQAAB5/wlQ (envelope-from ) for ; Mon, 10 Aug 2020 16:45:36 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (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 C9013940390 for ; Mon, 10 Aug 2020 16:45:33 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 00C3D29B13; Mon, 10 Aug 2020 12:45:24 -0400 (EDT) Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) by mail.notmuchmail.org (Postfix) with ESMTPS id 604011FF91 for ; Mon, 10 Aug 2020 12:45:22 -0400 (EDT) Received: from mithlond (mobile-access-bcee73-232.dhcp.inet.fi [188.238.115.232]) (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 453B02024D; Mon, 10 Aug 2020 19:45:18 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1597077918; 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=DeQJqQ+7BH2gwjL5etXJYpQ5zp3dFN6OXxnbWoq0dbg=; b=jhcJAjHE1g1MTNvJZIq39wr5Jdd1QuTXp1msL4ccGpxVBgUCYKtWM6nu1h0nd3FgFchnS5 5YOnUGjPFr6TyAAgyyi0RaCn7Yxqxcafe555oHIhDoX5kRTriTPiq/BrDMDwkjGYD/gp7I rBpmkBgjNwQsHd9bqBYKkgn6SM3Vq0s= From: Teemu Likonen To: tomi.ollila@iki.fi, notmuch@notmuchmail.org Subject: Re: [PATCH v5] Emacs: Ensure left-to-right display for message headers In-Reply-To: References: <874kpfq14z.fsf@iki.fi> <20200807044641.3745-1-tlikonen@iki.fi> Date: Mon, 10 Aug 2020 19:45:11 +0300 Message-ID: <87v9hqv4a0.fsf@iki.fi> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1597077918; 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=DeQJqQ+7BH2gwjL5etXJYpQ5zp3dFN6OXxnbWoq0dbg=; b=V/TTGlN0B+QtbLzs4Qz5KAq7bYkG9/7RCxrK93cSr2YnuxhtRv2Y3dk5bL8ujysWXrfpR4 JtWWw97m2heLefX1GwGZM77skYsOIBkHjEUM528GQ3UNCg7wejZPIaoVoXffQNegx2Ef+3 I+GM9QnOZoehFSGLSG0fnPP/JbBtyPc= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1597077918; a=rsa-sha256; cv=none; b=DpYo/5VN1yJD4YHgFhzX8YHys0sv6wASisDSMXZr24Ygn5IQJH1H0o2cLtfAWQkrmwyEsx G0xzBLwiVPtLMXAaod1Ap5NbOgoxyTmNTOC8fp1W75+i2zphW/kt80wodSM6LlCisz3lWz 0c2KeoK+GZF/Q8AOIHIy8gPtMeT6jo8= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=tlikonen smtp.mailfrom=tlikonen@iki.fi Message-ID-Hash: V357DHCTBM7AXUERDVNQEIDIKUKGI3X4 X-Message-ID-Hash: V357DHCTBM7AXUERDVNQEIDIKUKGI3X4 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="===============0385692002403422260==" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=iki.fi header.s=meesny header.b=jhcJAjHE; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -0.07 X-TUID: zFsFXmgq7M+u --===============0385692002403422260== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable * 2020-08-09 23:12:28+03, utf wrote: > How about this =3DD > From: contains U+202E (LEFT-TO-RIGHT OVERRIDE) (in > =3D?utf-8?Q?T=3DE2=3D80=3DAEomi?=3D) 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 =E2=80=AEabc=E2=80=AC 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. =2D-=20 /// Teemu Likonen - .-.. http://www.iki.fi/tlikonen/ // OpenPGP: 4E1055DC84E9DFF613D78557719D69D324539450 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYIAC4WIQTJW2wqtelxC1gHdbitnXWr7pTCcwUCXzF5lxAcdGxpa29uZW5A aWtpLmZpAAoJEK2ddavulMJzIeUBAP/XzU0Hj5/oYzV5XDw+7N05ThFgmM9ylwHN C6qaBW+9AQDB22h5cgG9nEYBYi7dnlS44mI5Z9nsWrVhxTN+B4hYBA== =3iRJ -----END PGP SIGNATURE----- --=-=-=-- --===============0385692002403422260== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============0385692002403422260==--