From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 8E5396DE1030 for ; Thu, 27 Feb 2020 09:17:14 -0800 (PST) Authentication-Results: arlo.cworth.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pTzf46pD"; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.039 X-Spam-Level: X-Spam-Status: No, score=0.039 tagged_above=-999 required=5 tests=[AWL=-0.010, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nxwNWfZLSAaQ for ; Thu, 27 Feb 2020 09:17:12 -0800 (PST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by arlo.cworth.org (Postfix) with ESMTPS id E42436DE102E for ; Thu, 27 Feb 2020 09:17:05 -0800 (PST) Received: by mail-wr1-f42.google.com with SMTP id j16so2855731wrt.3 for ; Thu, 27 Feb 2020 09:17:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qLnLNHiw/iZxWZfBtHyu4Ttl3M5TIGjO3h9IYvDFU5g=; b=pTzf46pDrY9r32dZxM2jZvkrzWiy1fe65kW2gCyrTNqnjp+8ydTfHWRX6oThFAAm6O FhLQ/Ck4YYa5dPWbaULiV4o6uEoDE6XUpEwDhYKfwjAXsl+W8B40Uc/f6e1fuoaftDE3 cCa1njyRcVv8/pVXlxzpIcTVfLKSxXVLUXNU/iobxAuuPiPwJUKUksVUWfAww/wU3ZkS UbY0ZWj46+ll1zjSQzhvHOU3wAizF4d9EfSYN/P9mwMvfigU3FZgJxVaNALFNy6UUpUc sj1RLBS7WY5u+D4mUfJqZAUsiFz2dl4ZwGDdKm0xC2lQFE8n19BAF432hvp5sWCrDu27 +o1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qLnLNHiw/iZxWZfBtHyu4Ttl3M5TIGjO3h9IYvDFU5g=; b=XXkAULsg2lmoVhfrLa3j9M1RpU1coOATInQsvSiEj+t6RK34LOTVthsAenaib0x+hd 5yrzCJkFOCYkBX0wifTIlTDtL7EkoV4vcYPUwJCiKmnKbrWd3Jt6pNEq+G/7xdli59xa MNY6gf2EcBql/NSmZW6MroV4A0tBKrZInA0m1a5P8OQyzETLRBPuN+edMJ19uIxlruQg SNXO1d4fNmklxHT2pbu0ZNNXLvjCNUBFFxlp9JmA1/CuZqikAdPdJbs+PMMXh2+fNTmu U5GcKSXAdI3GbWXxjC6ueQ7qEXStEQ0W2c7vpGMBLIjjdUl93hU4mg6VAhIuxd59M5NY JjRw== X-Gm-Message-State: APjAAAWsDuUYZ12ZMztVnDjSjSI9ke70BnyDGJhqD/v3rkf4uO8+H6cu IKqqHLIQ1wt3/J2K8bJv+RcnBzdd X-Google-Smtp-Source: APXvYqys3WV3salAzIrhfJmBNn36aERyys20bkeXLS8ayOHz51fnrTyEwJrxcZ9ZL1gNGkKepaDuMg== X-Received: by 2002:a05:6000:118d:: with SMTP id g13mr5545864wrx.141.1582823823953; Thu, 27 Feb 2020 09:17:03 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id u23sm8568739wmu.14.2020.02.27.09.17.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Feb 2020 09:17:03 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 3/6] Unthreaded mode: allow different result format Date: Thu, 27 Feb 2020 17:16:49 +0000 Message-Id: <20200227171652.18187-4-markwalters1009@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200227171652.18187-1-markwalters1009@gmail.com> References: <20200227171652.18187-1-markwalters1009@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 17:17:14 -0000 It is likely that the user will want a different line format for unthreaded mode from tree mode; in particular the thread structure graphics are unnecessary in unthreaded mode. Add a new customisable variable and set it to something sensible. --- emacs/notmuch-tree.el | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index 80b830dd..760eaaec 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -76,6 +76,31 @@ Note the author string should not contain :type '(alist :key-type (string) :value-type (string)) :group 'notmuch-tree) +(defcustom notmuch-unthreaded-result-format + `(("date" . "%12s ") + ("authors" . "%-20s") + ((("subject" . "%s")) ." %-54s ") + ("tags" . "(%s)")) + "Result formatting for unthreaded Tree view. Supported fields are: date, + authors, subject, tree, tags. Tree means the thread tree + box graphics. The field may also be a list in which case + the formatting rules are applied recursively and then the + output of all the fields in the list is inserted + according to format-string. + +Note the author string should not contain + whitespace (put it in the neighbouring fields instead). + For example: + (setq notmuch-tree-result-format \(\(\"authors\" . \"%-40s\"\) + \(\"subject\" . \"%s\"\)\)\)" + :type '(alist :key-type (string) :value-type (string)) + :group 'notmuch-tree) + +(defun notmuch-tree-result-format () + (if notmuch-tree-unthreaded + notmuch-unthreaded-result-format + notmuch-tree-result-format)) + ;; Faces for messages that match the query. (defface notmuch-tree-match-face '((t :inherit default)) @@ -759,7 +784,7 @@ unchanged ADDRESS if parsing fails." ;; We need to save the previous subject as it will get overwritten ;; by the insert-field calls. (let ((previous-subject notmuch-tree-previous-subject)) - (insert (notmuch-tree-format-field-list notmuch-tree-result-format msg)) + (insert (notmuch-tree-format-field-list (notmuch-tree-result-format) msg)) (notmuch-tree-set-message-properties msg) (notmuch-tree-set-prop :previous-subject previous-subject) (insert "\n"))) -- 2.11.0