emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/notmuch-indicator 78d4b24917 1/4: Revert commit f563869


From: ELPA Syncer
Subject: [elpa] externals/notmuch-indicator 78d4b24917 1/4: Revert commit f563869b6a; use local map as f5c9b2e
Date: Wed, 28 Sep 2022 14:57:50 -0400 (EDT)

branch: externals/notmuch-indicator
commit 78d4b24917b5b4b1e13d8442b8afa144443f30fa
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Revert commit f563869b6a; use local map as f5c9b2e
    
    I made a mistake.  The original implementation by Henrik was correct.
    As Stefan Monnier pointed out on the emacs-devel mailing list, my
    design would have the last key override the previous ones:
    <https://lists.gnu.org/archive/html/emacs-devel/2022-09/msg01949.html>.
---
 notmuch-indicator.el | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/notmuch-indicator.el b/notmuch-indicator.el
index 9b598910e2..2df590cbcd 100644
--- a/notmuch-indicator.el
+++ b/notmuch-indicator.el
@@ -166,21 +166,17 @@ option `notmuch-indicator-refresh-count'."
    (shell-command-to-string
     (format "notmuch count %s" terms))))
 
-(defvar notmuch-indicator-mode-map
-  (let ((map (make-sparse-keymap)))
-    map)
-  "Keymap for the Notmuch indicator.")
-
 (defun notmuch-indicator--format-label (label count face terms)
   "Format LABEL, COUNT, FACE and TERMS of `notmuch-indicator-args'."
-  (define-key notmuch-indicator-mode-map [mode-line mouse-1]
-              (lambda () (interactive) (notmuch-search terms)))
-  (propertize
-   (if (and face label)
-       (format "%s%s " (propertize label 'face face) count)
-     (format "%s%s " (or label "") count))
-   'help-echo (format "mouse-1: Open notmuch search for `%s'" terms)
-   'local-map notmuch-indicator-mode-map))
+  (let ((map (make-sparse-keymap)))
+    (define-key map [mode-line mouse-1]
+                (lambda () (interactive) (notmuch-search terms)))
+    (propertize
+     (if (and face label)
+         (format "%s%s " (propertize label 'face face) count)
+       (format "%s%s " (or label "") count))
+     'help-echo (format "mouse-1: Open notmuch search for `%s'" terms)
+     'local-map map)))
 
 (defun notmuch-indicator--format-output (properties)
   "Format PROPERTIES of `notmuch-indicator-args'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]