diff options
| author | Daniel Mendler | 2025-03-08 09:23:53 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2025-03-13 06:08:58 +0100 |
| commit | ae33aad7f582864a8dbb0fee10f891fd67abdbe3 (patch) | |
| tree | 18d9bc1eb651b431f61ad921ddc6f9b1e30db47e | |
| parent | 99d034cfd3fd807570b14a56413fc61e2c964c65 (diff) | |
| download | emacs-ae33aad7f582864a8dbb0fee10f891fd67abdbe3.tar.gz emacs-ae33aad7f582864a8dbb0fee10f891fd67abdbe3.zip | |
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)
| -rw-r--r-- | lisp/window-tool-bar.el | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/lisp/window-tool-bar.el b/lisp/window-tool-bar.el index b8f84bd2da7..ace01885134 100644 --- a/lisp/window-tool-bar.el +++ b/lisp/window-tool-bar.el | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | ;; Version: 0.3 | 7 | ;; Version: 0.3 |
| 8 | ;; Keywords: mouse | 8 | ;; Keywords: mouse |
| 9 | ;; URL: http://github.com/chaosemer/window-tool-bar | 9 | ;; URL: http://github.com/chaosemer/window-tool-bar |
| 10 | ;; Package-Requires: ((emacs "27.1") (compat "29.1")) | 10 | ;; Package-Requires: ((emacs "27.1") (compat "30")) |
| 11 | 11 | ||
| 12 | ;; This is a GNU ELPA :core package. Avoid adding functionality that | 12 | ;; This is a GNU ELPA :core package. Avoid adding functionality that |
| 13 | ;; is not available in the version of Emacs recorded above or any of | 13 | ;; 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'." | |||
| 385 | (interactive) | 385 | (interactive) |
| 386 | nil) | 386 | nil) |
| 387 | 387 | ||
| 388 | ;; static-if was added in Emacs 30, but this packages supports earlier | ||
| 389 | ;; versions. | ||
| 390 | (defmacro window-tool-bar--static-if (condition then-form &rest else-forms) | ||
| 391 | "A conditional compilation macro. | ||
| 392 | Evaluate CONDITION at macro-expansion time. If it is non-nil, | ||
| 393 | expand the macro to THEN-FORM. Otherwise expand it to ELSE-FORMS | ||
| 394 | enclosed in a `progn' form. ELSE-FORMS may be empty." | ||
| 395 | (declare (indent 2) | ||
| 396 | (debug (sexp sexp &rest sexp))) | ||
| 397 | (if (eval condition lexical-binding) | ||
| 398 | then-form | ||
| 399 | (cons 'progn else-forms))) | ||
| 400 | |||
| 401 | (defvar window-tool-bar--ignored-event-types | 388 | (defvar window-tool-bar--ignored-event-types |
| 402 | (let ((list (append | 389 | (let ((list (append |
| 403 | '(mouse-movement pinch | 390 | '(mouse-movement pinch |
| 404 | wheel-down wheel-up wheel-left wheel-right) | 391 | wheel-down wheel-up wheel-left wheel-right) |
| 405 | ;; Prior to emacs 30, wheel events could also surface as | 392 | ;; Prior to emacs 30, wheel events could also surface as |
| 406 | ;; mouse-<NUM> buttons. | 393 | ;; mouse-<NUM> buttons. |
| 407 | (window-tool-bar--static-if (version< emacs-version "30") | 394 | (static-if (< emacs-major-version 30) |
| 408 | (list | 395 | (list |
| 409 | mouse-wheel-down-event mouse-wheel-up-event | 396 | mouse-wheel-down-event mouse-wheel-up-event |
| 410 | mouse-wheel-left-event mouse-wheel-right-event | 397 | mouse-wheel-left-event mouse-wheel-right-event |