Skip to content

Commit

Permalink
Use a copy of buttonize
Browse files Browse the repository at this point in the history
  • Loading branch information
DogLooksGood committed Dec 1, 2024
1 parent 8ae8b2c commit ec5a2cf
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions meow-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))))

Check warning on line 533 in meow-util.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

the function ‘button--properties’ is not known to be defined.

Check failure on line 533 in meow-util.el

View workflow job for this annotation

GitHub Actions / check (28.2, true)

You should depend on (emacs "29.1") or the compat package if you need `button--properties'.

Check failure on line 533 in meow-util.el

View workflow job for this annotation

GitHub Actions / check (27.1, true)

You should depend on (emacs "29.1") or the compat package if you need `button--properties'.

Check failure on line 533 in meow-util.el

View workflow job for this annotation

GitHub Actions / check (26.3, true)

You should depend on (emacs "29.1") or the compat package if you need `button--properties'.
;; 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.
Expand All @@ -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)
Expand Down

0 comments on commit ec5a2cf

Please sign in to comment.