From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oKaDIdWvr2JcrQAAbAwnHQ (envelope-from ) for ; Mon, 20 Jun 2022 01:23:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QCGNINWvr2IoZAAAG6o9tA (envelope-from ) for ; Mon, 20 Jun 2022 01:23:01 +0200 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 40BE82D378 for ; Mon, 20 Jun 2022 01:23:01 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id DA20B5F6B8; Sun, 19 Jun 2022 23:22:41 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 21C9C5F428 for ; Sun, 19 Jun 2022 23:22:39 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 6FDA65FC0D; Sun, 19 Jun 2022 19:22:38 -0400 (EDT) Received: (nullmailer pid 847111 invoked by uid 1000); Sun, 19 Jun 2022 23:22:33 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [RFC PATCH v2 7/7] WIP/emacs: display count of duplicates in headerline Date: Sun, 19 Jun 2022 20:21:53 -0300 Message-Id: <20220619232152.846823-8-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220619232152.846823-1-david@tethera.net> References: <20220619232152.846823-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 5VPG74UQYQZWWXH3HYJEHWDFSIKHOPM2 X-Message-ID-Hash: 5VPG74UQYQZWWXH3HYJEHWDFSIKHOPM2 X-MailFrom: bremner@tethera.net 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 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-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655680981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=bxMEVV/2Zv8Vn/cj5KZ93pS/41Qtyuy+FXCkBILJETI=; b=V0SkwgZ3N8Salq9s3TDMldOVTA/48ZsHcfo6XYM4UaOfKP/uwzQwh1NpYk8tHnCGpi/6Js 9SG4FlPCQF45bCdFpP5uFgVidGtgAl6sszrswCzU4v0NGYVXGA6XNLQXMZBxLq/thVepQs GfCFZMdQZtoxoV70I9OZVnSGLNBecntPuzHx/qBpXvPLechCaG7blkRe98598syKD30b8C KbUCCMIAML0gQ2Ox0DG3N9JGJm53pZSS/e3GXG+vjPFrMVHPjCt2NbigZm4qK5bkX2L4AP kiDqGSktn4Dddji9jT1E6nMXEdXmKmV0KjZlL82rtXzoGg9Ptm6i1y5leVRDYA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655680981; a=rsa-sha256; cv=none; b=ml+9rjgQq9MzB1DhEYlHSa8VToiaO+RHFJXYyYF44Zp4Rr0h2XpYtMV9QkRqFg16FCSeyH O3MKuvcBxl4fPFxYji3eWE72+TGs66ydRPm+CCzioWf2fXf5CCv4iI1I0XUNV3SVoyqQZh d9KyAPm/ORwKP+hZQdVz62u1k4OLncpBwo9HWmgHMTNHxikmKrJ5Xk23eLxfyW4+XZNqvh j/3H10hEuN6v0kfmJjVBTAX2yBAhDGqQtVIQCvvtkl+99Mo5hQT032hjONq6d1eDsCcYG3 icsAiY9iTM5qjuSQ9nS0wR/5BsImH9rl2sxJ31XklH3Y+hTrTqASTc4QQRx9pw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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: -1.62 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 40BE82D378 X-Spam-Score: -1.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: 8OzAbSRtx8yb --- emacs/notmuch-show.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 1777756b..32d0edc5 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -493,7 +493,7 @@ Return unchanged ADDRESS if parsing fails." ;; Otherwise format the name and address together. (concat p-name " <" p-address ">")))) -(defun notmuch-show-insert-headerline (headers date tags depth) +(defun notmuch-show-insert-headerline (headers date tags depth duplicate file-count) "Insert a notmuch style headerline based on HEADERS for a message at DEPTH in the current thread." (let ((start (point)) @@ -513,7 +513,14 @@ message at DEPTH in the current thread." date ") (" (notmuch-tag-format-tags tags tags) - ")\n") + ")") + (insert + (if (> file-count 1) + (let ((txt (format "%d/%d\n" duplicate file-count))) + (concat + (notmuch-show-spaces-n (- (window-width) (+ (current-column) (length txt)))) + txt)) + "\n")) (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face))) @@ -1104,6 +1111,8 @@ is t, hide the part initially and show the button." (defun notmuch-show-insert-msg (msg depth) "Insert the message MSG at depth DEPTH in the current thread." (let* ((headers (plist-get msg :headers)) + (duplicate (or (plist-get msg :duplicate) 0)) + (files (length (plist-get msg :filename))) ;; Indentation causes the buffer offset of the start/end ;; points to move, so we must use markers. message-start message-end @@ -1115,7 +1124,7 @@ is t, hide the part initially and show the button." (or (and notmuch-show-relative-dates (plist-get msg :date_relative)) (plist-get headers :Date)) - (plist-get msg :tags) depth) + (plist-get msg :tags) depth duplicate files) (setq content-start (point-marker)) ;; Set `headers-start' to point after the 'Subject:' header to be ;; compatible with the existing implementation. This just sets it -- 2.35.2