diff options
| author | Jared Finder | 2024-12-14 09:30:43 +0100 |
|---|---|---|
| committer | Michael Albinus | 2024-12-14 09:30:43 +0100 |
| commit | 2719dccbe5797dd8fcf1ce013df2ff71161b6f55 (patch) | |
| tree | 445ba9bd6b60149784b3c79d7e0a740a9e987e92 /test | |
| parent | b6807a7ddce41e99d320be5f23972f218af004a8 (diff) | |
| download | emacs-2719dccbe5797dd8fcf1ce013df2ff71161b6f55.tar.gz emacs-2719dccbe5797dd8fcf1ce013df2ff71161b6f55.zip | |
Fix for xt-mouse-tests.el broken in prior commit
xt-mouse-tests not turning on xterm-mouse-mode if it was already
on did not work with xterm-mouse-mode being set to t by default.
It turns out that xt-mouse-tests already does not report proper
results when called inside a running Emacs session so the code
path is not useful anyways.
* test/lisp/xt-mouse-tests.el (with-xterm-mouse-mode): Always
turn on xterm-mouse-mode, even if it is already on.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/xt-mouse-tests.el | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/lisp/xt-mouse-tests.el b/test/lisp/xt-mouse-tests.el index cfc8042f796..f64b3aed73e 100644 --- a/test/lisp/xt-mouse-tests.el +++ b/test/lisp/xt-mouse-tests.el | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | 25 | ||
| 26 | (require 'xt-mouse) | 26 | (require 'xt-mouse) |
| 27 | 27 | ||
| 28 | ;; FIXME: this doesn't work when called inside a non-batch mode Emacs | ||
| 29 | ;; session. | ||
| 28 | (defmacro with-xterm-mouse-mode (&rest body) | 30 | (defmacro with-xterm-mouse-mode (&rest body) |
| 29 | "Run BODY with `xterm-mouse-mode' temporarily enabled." | 31 | "Run BODY with `xterm-mouse-mode' temporarily enabled." |
| 30 | (declare (indent 0)) | 32 | (declare (indent 0)) |
| @@ -42,18 +44,16 @@ | |||
| 42 | ((terminal-parameter nil 'xterm-mouse-y) nil) | 44 | ((terminal-parameter nil 'xterm-mouse-y) nil) |
| 43 | ((terminal-parameter nil 'xterm-mouse-last-down) nil) | 45 | ((terminal-parameter nil 'xterm-mouse-last-down) nil) |
| 44 | ((terminal-parameter nil 'xterm-mouse-last-click) nil)) | 46 | ((terminal-parameter nil 'xterm-mouse-last-click) nil)) |
| 45 | (if xterm-mouse-mode | 47 | (unwind-protect |
| 46 | ,(macroexp-progn body) | 48 | (progn |
| 47 | (unwind-protect | 49 | ;; `xterm-mouse-mode' doesn't work in the initial |
| 48 | (progn | 50 | ;; terminal. Since we can't create a second |
| 49 | ;; `xterm-mouse-mode' doesn't work in the initial | 51 | ;; terminal in batch mode, fake it temporarily. |
| 50 | ;; terminal. Since we can't create a second | 52 | (cl-letf (((symbol-function 'terminal-name) |
| 51 | ;; terminal in batch mode, fake it temporarily. | 53 | (lambda (&optional _terminal) "fake-terminal"))) |
| 52 | (cl-letf (((symbol-function 'terminal-name) | 54 | (xterm-mouse-mode 1)) |
| 53 | (lambda (&optional _terminal) "fake-terminal"))) | 55 | ,@body) |
| 54 | (xterm-mouse-mode)) | 56 | (xterm-mouse-mode 0)))) |
| 55 | ,@body) | ||
| 56 | (xterm-mouse-mode 0))))) | ||
| 57 | (set-frame-width nil width) | 57 | (set-frame-width nil width) |
| 58 | (set-frame-height nil height)))) | 58 | (set-frame-height nil height)))) |
| 59 | 59 | ||