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 AGxrAMOKKl+KfgAA0tVLHw (envelope-from ) for ; Wed, 05 Aug 2020 10:32:35 +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 kFfWN8KKKl/vCAAAB5/wlQ (envelope-from ) for ; Wed, 05 Aug 2020 10:32:34 +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 CBD379401CB for ; Wed, 5 Aug 2020 10:32:33 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A22F829A94; Wed, 5 Aug 2020 06:32:27 -0400 (EDT) Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) by mail.notmuchmail.org (Postfix) with ESMTPS id 2E9F81FA17 for ; Wed, 5 Aug 2020 06:32:25 -0400 (EDT) Received: from mithlond.arda (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 X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: tlikonen) by meesny.iki.fi (Postfix) with ESMTPSA id 83CD0209EB; Wed, 5 Aug 2020 13:32:23 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1596623543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZG+htcVLRLs11noZY0cZCi1/Q1mbsU7FESZ2SR4vMhw=; b=JGh4pMy7EucrEwE5WxqooSy7rcZ7tDNHh37yDGTx/9ABpdzh8HxX7FO7tPnY8wIb5e0HWB C5qYLcoE6ODRqhURvl+v6v+8Tks1Twp09fWyUqETqNtRQe/4C6rUZR9qc3gofHEL2LwWqo 8sqVCdIidvfYJB3AH1fg2EHv8+ikA8g= From: Teemu Likonen To: notmuch@notmuchmail.org Cc: Teemu Likonen , David Edmondson Subject: [PATCH v4] Emacs: Force left-to-right display for message headers Date: Wed, 5 Aug 2020 13:32:07 +0300 Message-Id: <20200805103207.14595-1-tlikonen@iki.fi> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1596623543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZG+htcVLRLs11noZY0cZCi1/Q1mbsU7FESZ2SR4vMhw=; b=G7TS8xmgc6DgGR27zbpI5aV4BXDOjFHNJFJi5LXmSWwNYjPFXzzwgXg+8Sk5EhNyyF47ZC z6P3yxwG9ywuua8OwBRj24gQobkP0KmxQvCCpE9MZPvPgepJVJsPEH+DY++KPsd0TBa7FJ MUJrGmPJlFhjD+J+RSv0GkaC6EZq9hI= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1596623543; a=rsa-sha256; cv=none; b=RZLYVUt7+afPhN/EztfHqSSgOD8cU8YUFfd+ExJR6vrO0DkDDG+8Pun3QtOaxi8sse4LQL 862TWrz1z1hCYMEYZbPdOsMSNFREqLjKAPpmE7DV5Hv/HOfjVnxeqrtxqmVc1Xf/TLQkSG 9W08EuzYlylvgosFSp3ki6KUxGw7fSk= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=tlikonen smtp.mailfrom=tlikonen@iki.fi Message-ID-Hash: L5VTXWIJMS6TMEWNOIAYMTHLJNPCLWDS X-Message-ID-Hash: L5VTXWIJMS6TMEWNOIAYMTHLJNPCLWDS 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=iki.fi header.s=meesny header.b=JGh4pMy7; 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: 3.03 X-TUID: oymTeAhvaQmz Insert invisible U+200E LEFT-TO-RIGHT MARK character at the beginning of message header paragraph in notmuch-show buffer. The U+200E character forces the header paragraph as left-to-right text even if the header content started with right-to-left characters. See Emacs Lisp reference manual section "(elisp) Bidirectional Display" for more info. Reviewed-by: David Edmondson --- emacs/notmuch-show.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index c9170466..6548891f 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -466,9 +466,14 @@ unchanged ADDRESS if parsing fails." (defun notmuch-show-insert-headerline (headers date tags depth) "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) + ;; Add invisible U+200E LEFT-TO-RIGHT MARK character (see + ;; above) to force the header paragraph as left-to-right + ;; text even if the header content started with + ;; right-to-left characters. + (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth)) (notmuch-sanitize (notmuch-show-clean-address (plist-get headers :From))) " (" date -- 2.20.1