window-tool-bar: Use `static-if' from Compat 30
* lisp/window-tool-bar.el (window-tool-bar--static-if): Remove macro. (window-tool-bar--ignored-event-types): Use `static-if' from Compat instead. (Bug#76858)
This commit is contained in:
parent
99d034cfd3
commit
ae33aad7f5
1 changed files with 2 additions and 15 deletions
|
@ -7,7 +7,7 @@
|
||||||
;; Version: 0.3
|
;; Version: 0.3
|
||||||
;; Keywords: mouse
|
;; Keywords: mouse
|
||||||
;; URL: http://github.com/chaosemer/window-tool-bar
|
;; URL: http://github.com/chaosemer/window-tool-bar
|
||||||
;; Package-Requires: ((emacs "27.1") (compat "29.1"))
|
;; Package-Requires: ((emacs "27.1") (compat "30"))
|
||||||
|
|
||||||
;; This is a GNU ELPA :core package. Avoid adding functionality that
|
;; This is a GNU ELPA :core package. Avoid adding functionality that
|
||||||
;; is not available in the version of Emacs recorded above or any of
|
;; is not available in the version of Emacs recorded above or any of
|
||||||
|
@ -385,26 +385,13 @@ MENU-ITEM is a menu item to convert. See info node `(elisp)Tool Bar'."
|
||||||
(interactive)
|
(interactive)
|
||||||
nil)
|
nil)
|
||||||
|
|
||||||
;; static-if was added in Emacs 30, but this packages supports earlier
|
|
||||||
;; versions.
|
|
||||||
(defmacro window-tool-bar--static-if (condition then-form &rest else-forms)
|
|
||||||
"A conditional compilation macro.
|
|
||||||
Evaluate CONDITION at macro-expansion time. If it is non-nil,
|
|
||||||
expand the macro to THEN-FORM. Otherwise expand it to ELSE-FORMS
|
|
||||||
enclosed in a `progn' form. ELSE-FORMS may be empty."
|
|
||||||
(declare (indent 2)
|
|
||||||
(debug (sexp sexp &rest sexp)))
|
|
||||||
(if (eval condition lexical-binding)
|
|
||||||
then-form
|
|
||||||
(cons 'progn else-forms)))
|
|
||||||
|
|
||||||
(defvar window-tool-bar--ignored-event-types
|
(defvar window-tool-bar--ignored-event-types
|
||||||
(let ((list (append
|
(let ((list (append
|
||||||
'(mouse-movement pinch
|
'(mouse-movement pinch
|
||||||
wheel-down wheel-up wheel-left wheel-right)
|
wheel-down wheel-up wheel-left wheel-right)
|
||||||
;; Prior to emacs 30, wheel events could also surface as
|
;; Prior to emacs 30, wheel events could also surface as
|
||||||
;; mouse-<NUM> buttons.
|
;; mouse-<NUM> buttons.
|
||||||
(window-tool-bar--static-if (version< emacs-version "30")
|
(static-if (< emacs-major-version 30)
|
||||||
(list
|
(list
|
||||||
mouse-wheel-down-event mouse-wheel-up-event
|
mouse-wheel-down-event mouse-wheel-up-event
|
||||||
mouse-wheel-left-event mouse-wheel-right-event
|
mouse-wheel-left-event mouse-wheel-right-event
|
||||||
|
|
Loading…
Add table
Reference in a new issue