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 ms0.migadu.com with LMTPS id 2MSvDZNp8WGY0gAAgWs5BA (envelope-from ) for ; Wed, 26 Jan 2022 16:32:35 +0100 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 CN22BJNp8WEiCwEAG6o9tA (envelope-from ) for ; Wed, 26 Jan 2022 16:32:35 +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 C281238FF7 for ; Wed, 26 Jan 2022 16:32:33 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 5C7165F6C3; Wed, 26 Jan 2022 15:32:31 +0000 (UTC) Received: from anarres.sindominio.net (anarres.sindominio.net [88.99.208.38]) by mail.notmuchmail.org (Postfix) with ESMTPS id DACFE5E022 for ; Wed, 26 Jan 2022 15:32:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lesnaus.sindominio.net with ESMTP id DE700365C75 for ; Wed, 26 Jan 2022 16:32:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 lesnaus.sindominio.net DE700365C75 Received: from anarres.sindominio.net ([127.0.0.1]) by localhost (lesnaus.sindominio.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PUHbVj6aiBiy for ; Wed, 26 Jan 2022 16:32:25 +0100 (CET) Received: by lesnaus.sindominio.net (Postfix, from userid 108) id CE9FC365C79; Wed, 26 Jan 2022 16:32:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 lesnaus.sindominio.net CE9FC365C79 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lesnaus.sindominio.net with ESMTPSA id 6006E365C73; Wed, 26 Jan 2022 16:32:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 lesnaus.sindominio.net 6006E365C73 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sindominio.net; s=mail; t=1643211143; bh=sN4QRSnHHQ6phu/KVm973eUaJT/+gogx7sNmUazf1mU=; h=From:To:Cc:Subject:Date:From; b=t+FQp25xVZq8VT30YzTbcYx8EKaiBKCrVk7MO2Y9kWMjNhBXzMoM3SvhvT87Me4Aq 0/0Z79jhKnHUfkZwgiNqm1VpFbSmnK2WfmzIlM6nJgbbSZBPqvsXXuO9XtpErZr+57 QQXsA86x50s5zm1ALFGblhFu8j5mtBV8jAGy2r5DhoCj4k9IIGo9Ad4YSnAWYKgHcQ UQ342b5cZ/WP5R4WRr2wxGO4X4Sg8EiKeYiohApxI4tffGOa4AJ9/sIA+4W0InQkH8 PIlhXXASjkgHu2B5SwoH0OzfKhM0J1kpJVrY+QBGqGX7ImyQSF38WUT8qzn2y4NjL1 mZoozmg3D+NbVSePt6eN/9LV03vt2DSiJIDnroFkLgqJmlpf1xocnFklpZk1Z+G6ut qFE4aP/YH8I+cNF3yxxx1fzRi6qyNoxi+UryS1jT5YBo4Hkkc3hAeD18qVIkRYzgyE B1+0baSdIr5N8xZPO9cv90hzaw8yjLn+IcyaQre4wF+IquU1Fn5rVFmu1HNP4EL/oj rD9xhxTZC9fc6vEmcG0RZSpEn9Z8jU305pIeLwkKJ+dz3nfgrnf6OlRDEZcNUohAj+ xe0cLVEK58ktaL3il39cjKxHJ7TIh3NDMgCLHu23oshQN0K8F7FytV5aw5ug5zaUZK WXTJtszMxO1tjLQ/AdH8BhT0= From: inwit To: notmuch@notmuchmail.org Subject: [PATCH] emacs: add global tag history Date: Wed, 26 Jan 2022 16:32:14 +0100 Message-Id: <20220126153214.1366353-1-inwit@sindominio.net> MIME-Version: 1.0 Message-ID-Hash: SXISSLNRSK2VDKZHY2E6GKVGARTXTJDI X-Message-ID-Hash: SXISSLNRSK2VDKZHY2E6GKVGARTXTJDI X-MailFrom: inwit@sindominio.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 CC: inwit 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=1643211154; 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=9eFIomZ+7Q15LykC8S9OezpeobBMsbmgkAxwwgIYYHM=; b=NmQ9O/jC/6OLB6umRxRhizfIhNvVC46igoixlDdbP8JAclsiabWGcGyUEAv7VNqLLV/VNR rQV90lej8o2LJdLYwkFksczz1YDK4ObkGIIM/p+BzyyvN8n56NWJDfououeWH2kYgLY/Xj Qwku56ncm9iiYk5zJ3DMkOxmKyhGSOIcPtd+EuYNfT7Fj4UsotsVjEg7WvGUPDLKLBZbQ7 u+szDXYEO5mHZgrmVgxNWUWvFJbJ9x4fzY5GkKCjuO08mmge18gtgB4dCYLFYKZKWTVdj/ Vp9uEWEefJtMQTLJFxiOkDrnROMCDFp9QTNwHgMFBczSPYEL7+pQCUNwDrQVZg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643211154; a=rsa-sha256; cv=none; b=DCgEbOXII5r3NCs6/Cgrgmu7yGXEuveq4axlW+46OrwozwvtUG0wGmZo1R38OMgKzjoC1v lEPTjb2LKTcf/mLPWebYgJlSfJ2pBnhhXRu5LdBLumxfGFXlhFiL3R5MbgmSzssulIylRH sb+vv2ETS61lF9aGgrVj9tlpJYiN65dPswx6SMZ1vzUTzZdKt/Oxn/sm1xKJTKnuLBnsra JcZr5GUU9lESPDY761HEYyy7EDRj6XQVGxD9WAagmqLguZ1wu3O9ULlLrR6CLZpllkMC+P lzK5e6G1x3Vc0o6Ps+L1imPBrY8HGCkVwe0kAMfy8B7wxVBf2LVtyYKroyj7yQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=sindominio.net header.s=mail header.b=t+FQp25x; dmarc=fail reason="SPF not aligned (relaxed)" header.from=sindominio.net (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: -0.24 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=sindominio.net header.s=mail header.b=t+FQp25x; dmarc=fail reason="SPF not aligned (relaxed)" header.from=sindominio.net (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: C281238FF7 X-Spam-Score: -0.24 X-Migadu-Scanner: scn1.migadu.com X-TUID: TJz+zCXKdp/Q Save a list of every tag change in the new variable notmuch-tag-history. --- Storing the full history of tags can prove useful for a) repeated tag changes as in [0] and b) eventually logging and undoing tag changes. This is my first commit in elisp. I expect turbulences ahead. :) [0] https://nmbug.notmuchmail.org/nmweb/show/CCSQ9HR3M748.2IRNNTHYR4A2M%40bisio emacs/notmuch-tag.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index 8af09e68..68341cf2 100644 --- a/emacs/notmuch-tag.el +++ b/emacs/notmuch-tag.el @@ -388,6 +388,9 @@ the messages that were tagged." (defvar notmuch-read-tag-changes-history nil "Minibuffer history of `notmuch-read-tag-changes' function.") +(defvar notmuch-tag-history nil + "Global history of `notmuch-tag' function.") + (defun notmuch-tag-completions (&rest search-terms) "Return a list of tags for messages matching SEARCH-TERMS. @@ -478,6 +481,7 @@ notmuch-after-tag-hook will be run." (unless query (error "Nothing to tag!")) (when tag-changes + (push tag-changes notmuch-tag-history) (notmuch-dlet ((tag-changes tag-changes) (query query)) (run-hooks 'notmuch-before-tag-hook)) -- 2.32.0