diff options
| author | João Távora | 2025-04-20 13:24:52 +0100 |
|---|---|---|
| committer | João Távora | 2025-04-20 23:20:33 +0100 |
| commit | 77cd3a406b500f4106dde4b925fe4fec30b4a2fb (patch) | |
| tree | 7e41a35af74584a30fc00071b2422b0b811a73e5 | |
| parent | 53d732d775fb416f6a412c2a87f12beed682c96c (diff) | |
| download | emacs-77cd3a406b500f4106dde4b925fe4fec30b4a2fb.tar.gz emacs-77cd3a406b500f4106dde4b925fe4fec30b4a2fb.zip | |
Flymake: address some compatibility problems with older Emacsen
Can't use with-supressed-warnings, introduced in Emacs 27.1. Also can't
use multi-arg setq-local, probably introduced around the same time.
This commit by itself still doesn't allow Flymake to be loaded in Emacs
< 29. That fix will come in a later commit.
* lisp/progmodes/flymake.el (flymake--mode-line-counter-map):
Use with-no-warnings.
* lisp/progmodes/flymake.el (flymake--resize-margins): Use setq,
setq-local not needed.
| -rw-r--r-- | lisp/progmodes/flymake.el | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 2ea91ccb15c..65733ad9568 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -871,14 +871,14 @@ Return to original margin width if ORIG-WIDTH is non-nil." | |||
| 871 | (cond | 871 | (cond |
| 872 | ((and orig-width flymake--original-margin-width) | 872 | ((and orig-width flymake--original-margin-width) |
| 873 | (if (eq flymake-margin-indicator-position 'left-margin) | 873 | (if (eq flymake-margin-indicator-position 'left-margin) |
| 874 | (setq-local left-margin-width flymake--original-margin-width) | 874 | (setq left-margin-width flymake--original-margin-width) |
| 875 | (setq-local right-margin-width flymake--original-margin-width))) | 875 | (setq right-margin-width flymake--original-margin-width))) |
| 876 | (t | 876 | (t |
| 877 | (if (eq flymake-margin-indicator-position 'left-margin) | 877 | (if (eq flymake-margin-indicator-position 'left-margin) |
| 878 | (setq-local flymake--original-margin-width left-margin-width | 878 | (setq flymake--original-margin-width left-margin-width |
| 879 | left-margin-width 2) | 879 | left-margin-width 2) |
| 880 | (setq-local flymake--original-margin-width right-margin-width | 880 | (setq flymake--original-margin-width right-margin-width |
| 881 | right-margin-width 2)))) | 881 | right-margin-width 2)))) |
| 882 | ;; Apply margin to all windows available. | 882 | ;; Apply margin to all windows available. |
| 883 | (mapc (lambda (x) | 883 | (mapc (lambda (x) |
| 884 | (set-window-buffer x (window-buffer x))) | 884 | (set-window-buffer x (window-buffer x))) |
| @@ -1895,8 +1895,7 @@ correctly.") | |||
| 1895 | (let ((map (make-sparse-keymap))) | 1895 | (let ((map (make-sparse-keymap))) |
| 1896 | ;; BEWARE: `mouse-wheel-UP-event' corresponds to `wheel-DOWN' events | 1896 | ;; BEWARE: `mouse-wheel-UP-event' corresponds to `wheel-DOWN' events |
| 1897 | ;; and vice versa!! | 1897 | ;; and vice versa!! |
| 1898 | (with-suppressed-warnings | 1898 | (with-no-warnings |
| 1899 | ((obsolete mouse-wheel-up-event mouse-wheel-down-event)) | ||
| 1900 | (define-key map (vector 'mode-line mouse-wheel-down-event) | 1899 | (define-key map (vector 'mode-line mouse-wheel-down-event) |
| 1901 | #'flymake--mode-line-counter-scroll-prev) | 1900 | #'flymake--mode-line-counter-scroll-prev) |
| 1902 | (define-key map [mode-line wheel-down] | 1901 | (define-key map [mode-line wheel-down] |