From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 3IX8DoWi22E+nAAAgWs5BA (envelope-from ) for ; Mon, 10 Jan 2022 04:05:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cCLRCoWi22F+AAAAauVa8A (envelope-from ) for ; Mon, 10 Jan 2022 04:05:41 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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) by aspmx1.migadu.com (Postfix) with ESMTPS id 698A24414E for ; Mon, 10 Jan 2022 04:05:40 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id BE1A35F704; Mon, 10 Jan 2022 03:05:35 +0000 (UTC) Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by mail.notmuchmail.org (Postfix) with ESMTPS id D99B25F5EB for ; Mon, 10 Jan 2022 03:05:32 +0000 (UTC) Received: from [2001:470:142:3::e] (port=36620 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6kzy-0001e4-Dk; Sun, 09 Jan 2022 22:05:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=y4rja1sOkH+V2+nJe+Jku0Ur6emreuYtmYXD9A6jAns=; b=pU5xvsdL37ncfJ U6UI9+aGahQvBVrpoM5c92tQT3PSQPBzCOyTZiyFNY1AgaN1tyZHcCxtun3TnRdO4xEnc7sOqmMXP bIk9cBEyfbgCsbZ8+fqPGLoqFFgmDqHoGdzHOa6eaSG74kzH6KTYcAssyQFztWTkY+/VPMlz+01p2 0ONjjAtObeYkQdd36zhmMwFFqN38gqGsw3Sl7V2USkJGAQcIKyBjiPrXO50Sc6nXk+5mzXY+44yyg GHvb+9VN349t28ErS7G7lI0pVJ5dGPinOfW+G3u3ra9p4SldRHmlf3hKY0Yv9xzCOG6k0FFKg3u5U uWD42Zqe/rNBMxM0V9Ng==; Received: from 92.40.178.238.threembb.co.uk ([92.40.178.238]:9721 helo=rivendell.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6kzy-0005cV-B0; Sun, 09 Jan 2022 22:05:30 -0500 From: jao To: notmuch@notmuchmail.org Subject: [PATCH v2] emacs: make header line in notmuch-show buffers optional Date: Mon, 10 Jan 2022 03:05:23 +0000 Message-Id: <20220110030523.1225508-1-jao@gnu.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: JRN4POFNWYDR7GZLE37RVFCKCO355MJH X-Message-ID-Hash: JRN4POFNWYDR7GZLE37RVFCKCO355MJH X-MailFrom: jao@gnu.org 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; digests; suspicious-header CC: jao X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641783940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=fcwwTK+cdyK7BDrUS40Y1Em9LxnTMcI3mm07zWkZM30=; b=oCBNgTbxBIsE6ZSBkS4SQrFat1B2BV8IYPtw3EJBl6EBUn9OmIfMIAHAi/3I3JwGwk7WRk rM1ILt6dxOB0LkfF90bhoD1H6EV0IiObz4SBD+GXco5M0aXvK/PxMu7Shxx/5OJlzO9yLt Q9K+ATfBfqzp+dgtLD6FzwfMV/VCM/tshS/8PtS04zIu8VzZeF7yQm8eHkkvQfb0xQbAGP s5QSKDTwoJQAQQ+VBmXWMFIfM6Xv9Bs2xan3GRhOLhs9AxQYmaxJ5mQ88xuVFFJ1VSeJMT coaBZV/gppJGh5RUBIfN4IF2J9Zvxr10rrAsYoonOnSTzLF7lLBd9cR8w5FUhQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641783940; a=rsa-sha256; cv=none; b=RuQmi08TvfdQcy04gaaavMA8c8gLOH4Yih+ygeu1ogFK8Q3xDtwi5YVAg9Vc9nVM2bx1AY swDIW1Qlvb2HABYJttqyI70AfgtsQZRigHDX0VRRO+ToVMPstNjj/8eENarAJf0VfesorU TY3PrI1cHlyjghaz/Iai72Jv1l9d/N5vsmaDZtJ+oP0Z9ykdwD3OdBK1cpte9sj2nr5cF5 yArcHxAkRSaHv0NeS21zXCnGIOnNOskGy1IIyhyfbj3GYsXVtqKzuNdfOemuKE/oJoU2vz ePADhCDqi5dIpHcUmRYCtU7MYFl3EdlYdgMXLv6i4vLhzU0fTRpdYTd0MhwExw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=pU5xvsdL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 2.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=pU5xvsdL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 698A24414E X-Spam-Score: 2.70 X-Migadu-Scanner: scn1.migadu.com X-TUID: tkChNiJAsfn5 New notmuch-show-header-line customizable boolean to allow inhibiting a header line in notmuch-show-mode buffers (for instance, because one prefers to just include Subject in notmuch-message-headers). --- Second version: includes a link to the new variable's docstring in notmuch-show section of notmuch-emacs.rst Signed-off-by: jao --- doc/notmuch-emacs.rst | 3 +++ emacs/notmuch-show.el | 16 +++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst index 22aee340..fed619b7 100644 --- a/doc/notmuch-emacs.rst +++ b/doc/notmuch-emacs.rst @@ -222,6 +222,9 @@ Display of messages can be controlled by the following variables :index:`notmuch-message-headers-visible` |docstring::notmuch-message-headers-visible| +:index:`notmuch-show-header-line` + |docstring::notmuch-show-header-line| + .. _show-copy: Copy to kill-ring diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 4de3e423..7c1f02c9 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -84,6 +84,11 @@ visible for any given message." :type 'boolean :group 'notmuch-show) +(defcustom notmuch-show-header-line t + "Show a header line with the current message's subject." + :type 'boolean + :group 'notmuch-show) + (defcustom notmuch-show-relative-dates t "Display relative dates in the message summary line." :type 'boolean @@ -1345,11 +1350,12 @@ If no messages match the query return NIL." (notmuch-show-mapc (lambda () (notmuch-show-set-prop :orig-tags (notmuch-show-get-tags)))) ;; Set the header line to the subject of the first message. - (setq header-line-format - (replace-regexp-in-string "%" "%%" - (notmuch-sanitize - (notmuch-show-strip-re - (notmuch-show-get-subject))))) + (when notmuch-show-header-line + (setq header-line-format + (replace-regexp-in-string "%" "%%" + (notmuch-sanitize + (notmuch-show-strip-re + (notmuch-show-get-subject)))))) (run-hooks 'notmuch-show-hook) (if state (notmuch-show-apply-state state) -- 2.34.1