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

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

[nongnu] elpa/meow ec5a2cf00a 4/8: Use a copy of buttonize


From: ELPA Syncer
Subject: [nongnu] elpa/meow ec5a2cf00a 4/8: Use a copy of buttonize
Date: Sun, 1 Dec 2024 07:00:22 -0500 (EST)

branch: elpa/meow
commit ec5a2cf00acdceca651c5440ca39b079b2dceabc
Author: DogLooksGood <doglooksgood@hotmail.com>
Commit: DogLooksGood <doglooksgood@hotmail.com>

    Use a copy of buttonize
---
 meow-util.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/meow-util.el b/meow-util.el
index 8454b21048..a2703a8d70 100644
--- a/meow-util.el
+++ b/meow-util.el
@@ -526,6 +526,15 @@ to use the status buffer's original `k' binding at point."
         (upcase c)
       c)))
 
+(defun meow--make-button (string callback &optional data help-echo)
+  "Copy from buttonize, which is available in Emacs 29.1"
+  (let ((string
+         (apply #'propertize string
+                (button--properties callback data help-echo))))
+    ;; Add the face to the end so that it can be overridden.
+    (add-face-text-property 0 (length string) 'button t string)
+    string))
+
 (defun meow--parse-def (def)
   "Return a command or keymap for DEF.
 
@@ -538,9 +547,7 @@ that bound to DEF. Otherwise, return DEF."
           (lambda ()
             (:documentation
              (format "Execute the command which is bound to %s."
-                     (if (version<= "29.1" emacs-version)
-                         (buttonize def 'describe-key (kbd def))
-                       def)))
+                     (meow--make-button def 'describe-key (kbd def))))
             (interactive)
             (meow--execute-kbd-macro def)))
         (put cmd-name 'meow-dispatch def)



reply via email to

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