From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 IJ4oBbfM2WExaQEAgWs5BA (envelope-from ) for ; Sat, 08 Jan 2022 18:41:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EN6RArfM2WGzsAAA9RJhRA (envelope-from ) for ; Sat, 08 Jan 2022 18:41:11 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 8F0DA13354 for ; Sat, 8 Jan 2022 18:41:10 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 29A185F71D; Sat, 8 Jan 2022 17:41:06 +0000 (UTC) Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by mail.notmuchmail.org (Postfix) with ESMTPS id 3A5445F717 for ; Sat, 8 Jan 2022 17:41:03 +0000 (UTC) Received: from [2001:470:142:3::e] (port=35728 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 1n6Fi9-000775-92; Sat, 08 Jan 2022 12:41:01 -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=DxwT7q0FUej+frlW5ZV4zSUGfySJV7ZXlBg1MyxqGA8=; b=R+03iK+mYrbm6q xNmIWGBJjYTfzJ6F+qJlKQJiUBzQEznPG1ge2RDFJK1ZXU7u86BFKpsZUr+511jm1Y0YkASbdrgFe bVBxP5FnkpOJfAyiQQS/JQWCQaGkgG0gTkwSMTirxVAe14XGAExHO7qLEKavn4E+drMQ2VVijGvI7 cR6dMafnGGPdBHeEQDSw0NwBSZQhe1YYnvQeqP4uUZN1p6SP2hFkNZf6OfuGsIvUFMrLToVXWNZJN O2DgraKvsFLmogscnXTwrVMzwmA207hL3G3/zfCjNJa+7jlqGfyyDFeg/PTejREcATjv4d4Oi9WjW PB1+FaDIfT7+ogv04vLg==; Received: from 92.40.173.17.threembb.co.uk ([92.40.173.17]:53837 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 1n6Fi8-00019o-Nv; Sat, 08 Jan 2022 12:41:01 -0500 From: jao To: notmuch@notmuchmail.org Subject: [PATCH] emacs: make header line in notmuch-show buffers optional Date: Sat, 8 Jan 2022 17:40:00 +0000 Message-Id: <20220108174000.996996-1-jao@gnu.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: 7MORIQ5GEX3SPQUSYBGO4DDAJ7ZMH3DB X-Message-ID-Hash: 7MORIQ5GEX3SPQUSYBGO4DDAJ7ZMH3DB 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=1641663670; 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=/87qZ5H041IoN0GpuAxMRqF3ziBGaU6Y4JC2iFycH+4=; b=NXs2fei7ETz9bHZeq0OObmVnAkO8jxDC9Y8hOnGsKXgc0QOYH3YmwgGH6//JKbEvdRtXj0 gxOxu38q8/eEYGgHY/CvkRs0QuOF+D3kC5FXs8Otfer0ud3MKFvo6goXMbMTXvxxvHsQJg JvPz1cyF9F7/rh4MQEoY2+RY5Gn9X+Wm7qhxVzEfd20m2g1jkvROgemjYifQozA0tKrMJY KqkUEHERP0iObuNtWraqrv3cB0MeVC0HSE7z/mKQ1Nq6kA1Dxz+ZCLTDuh/DDj5fm1pc/l LLj5ByCEUNJE1QOP2MvmkqvmnD2ONcBdqKskgGJdb12/8APdE8EnApkca44GfA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641663670; a=rsa-sha256; cv=none; b=cfyN1d8mm01Na1Iap2A9q1A9seUJr4x7twKEG238fjA91kZIXxY2Q/Lk0j/RDglUhSn/0u 2vEHipIu8I+sdsiUD1sQgKtMOnqfKIiArgh1kE/m8X1J7h1ikZk+4PLZfvTaZ+85VskZA2 pRt9bhgbvxc+A6XcUWH27wPIo5vzRZDIdeFbsFcpXTvSPUGLTYkACWT/2c1g7T+2UfU3o3 JQ7oUNGqqeBWx9BaRqEVGrUAUkJTYQhj0tvZjfJUvMes0L3N9AjTtZo1ghzRINodP4sIii Cvsq+TZMMTR3uN/tYJSrkJPS3E4d7Xe7lsN7F/Xyo09/BuSvcj2Ms9j5qisyAQ== 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=R+03iK+m; 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 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.63 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=R+03iK+m; 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 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 8F0DA13354 X-Spam-Score: -0.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: 8QRPTfmlLGi1 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). Signed-off-by: jao --- emacs/notmuch-show.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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