From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6PKHEOlbMV8rYwAA0tVLHw (envelope-from ) for ; Mon, 10 Aug 2020 14:38:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id eHsyDOlbMV/+UQAAbx9fmQ (envelope-from ) for ; Mon, 10 Aug 2020 14:38:33 +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 928D19400BF for ; Mon, 10 Aug 2020 14:38:31 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 31E3929B0D; Mon, 10 Aug 2020 10:38:21 -0400 (EDT) Received: from lahtoruutu.iki.fi (unknown [IPv6:2a0b:5c81:1c1::37]) by mail.notmuchmail.org (Postfix) with ESMTPS id E07371FFA7 for ; Mon, 10 Aug 2020 10:38:18 -0400 (EDT) Received: from mithlond.arda (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 X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: tlikonen) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 2FE661B003B9; Mon, 10 Aug 2020 17:38:06 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1597070286; 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=WnAYStE5QrPoflLgzAclx51vII3NAaTYsW1+YN1fIH0=; b=wbfB0L6tI4xD1ReX3fE0YbRYAhd31NVyNCOkz/+dBoP91k9mlveisJX2xOkMYsayZlnL0C 3WJPVOnIkah7uJJEydB96aKkxCImZE3c85LRMbSAAGu6tDwRVdHmPNzCMsYo/HQmR8b6If 6lpNh9I8EUKSeWZPyznbK4Pq6CW2NJTCuWMZFhapFLxQuCehrlQ0HNolhogYu+/TrFQh2V gCXzr49kQB7A+fsKVS3MtVNnSMtflBFSIQGQhaI764ju3D9XsskrZWf5b8G/YsCGSdtZo+ paEcgtOyyybfniMu9uQIgx0FirVDCza5zLHtOu0pKbnB+V1QLY2jX1uWXdTIqw== From: Teemu Likonen To: David Edmondson , notmuch@notmuchmail.org Cc: Teemu Likonen Subject: [PATCH v2] Emacs: Indent first header line only when indentation is turned on Date: Mon, 10 Aug 2020 17:37:57 +0300 Message-Id: <20200810143757.3681-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=lahtoruutu; t=1597070286; 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=WnAYStE5QrPoflLgzAclx51vII3NAaTYsW1+YN1fIH0=; b=RHY4p9+KBWb0j6SM2k0ThoQhjU6bFsvASrMhQ4W9NfzdOSPHWCpFPL43jMhM0EU4UDIDM3 77UEuLMY6ZY665UvBjdQ1WXQw8qAMOYQj2x2e70nGvLimJ5ODDyQ9mDKF9FTxRLFplrRIb RU13d/zTAwBnL/3qWq11gBy9V06APQpJOfbl+JS7osYQDQ5PVieZvpSRkrVPqhLtA4fbW8 Lv+U38/SaM+uuNNQNmOwvbyPpkFrd/WJnjbW4H676LNzuXEGK4jqVhZlt8TGHf0blKHiXY foeKV713XTWYPO7EGto3722wdCZmxN+QWLJd5i70HaM+rzJBgpW7Dt3v6lUf1g== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1597070286; a=rsa-sha256; cv=none; b=DFsP3e7CXzzTehJvLPQXqzQYQctQXO8F8qCufdQzlKaEQG393fljbZ7J2JN4mQUsAv5VTN zYJb6jVAmmKS1K/aAXfZYCSzyMIuMDcYU3KFx1EM2vuMAekXUsPeI7zl/0JL+7zWhlfEHX O5SPtLmUK6As1sdZMriZn78xqSpyOOL8+HUCqJQQNWxQzeQ4KCDTqarOwSa1Gdqxc8Ganc ohIaY8rXqThsi+vKNGR/KDRyemf2TgJaiDBI1T1jzQX7jKtujDqi541iGtt6vZ0e3iD+je qcP0MZOEeb/cicpWLhdlJwmVZFiwsW99GZHVEmQEHyRokP7R4X+c9/NTxdvn4Q== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=tlikonen smtp.mailfrom=tlikonen@iki.fi Message-ID-Hash: LUU4QHFZA6NJSMRNFZR7CFGZF4KU6PN7 X-Message-ID-Hash: LUU4QHFZA6NJSMRNFZR7CFGZF4KU6PN7 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=lahtoruutu header.b=wbfB0L6t; 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: 4.53 X-TUID: M01n3DKhKvz4 Previously in message-show mode message's first header line (From header) was always indented, even if user had turned thread indentation off with "<" (notmuch-show-toggle-thread-indentation) command. This change modifies notmuch-show-insert-headerline function so that it doesn't indent the first header line if notmuch-show-indent-content variable is nil. --- emacs/notmuch-show.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) * 2020-08-10 11:19:10+01, David Edmondson wrote: >> + (insert (notmuch-show-spaces-n >> + (if notmuch-show-indent-content >> + (* notmuch-show-indent-messages-width depth) >> + 0)) > > Couldn't you also elide the call to `notmuch-show-spaces-n'? Indeed. diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 0eb27e33..444b2a45 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -474,7 +474,10 @@ message at DEPTH in the current thread." ;; invisible U+200E LEFT-TO-RIGHT MARK character which forces ;; the header paragraph as left-to-right text. (insert (propertize (string ?\x200e) 'invisible t))) - (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth)) + (insert (if notmuch-show-indent-content + (notmuch-show-spaces-n (* notmuch-show-indent-messages-width + depth)) + "") from " (" date -- 2.20.1