diff options
| author | Eli Zaretskii | 2022-12-03 21:43:36 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2022-12-03 21:43:36 +0200 |
| commit | afa4fcb95b4c698ffe94031f344f1f47aa6b2acf (patch) | |
| tree | 5a1a38b3e2f3ac2954bbd712abbab06c97beaa44 | |
| parent | f6e2f30f394a270c2eca9a9a14be46876d2a86e5 (diff) | |
| download | emacs-afa4fcb95b4c698ffe94031f344f1f47aa6b2acf.tar.gz emacs-afa4fcb95b4c698ffe94031f344f1f47aa6b2acf.zip | |
Fix "C-h k" when clicking on another frame
* lisp/help.el (help--analyze-key): Don't barf if the key sequence
includes a switch-frame event. (Bug#59785)
| -rw-r--r-- | lisp/help.el | 6 | ||||
| -rw-r--r-- | lisp/subr.el | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lisp/help.el b/lisp/help.el index 8e1b325141e..b709062cb27 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -861,11 +861,13 @@ in the selected window." | |||
| 861 | (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers) | 861 | (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers) |
| 862 | (memq 'drag modifiers)) | 862 | (memq 'drag modifiers)) |
| 863 | " at that spot" "")) | 863 | " at that spot" "")) |
| 864 | (click-pos (event-end event)) | ||
| 864 | ;; Use `posn-set-point' to handle the case when a menu item | 865 | ;; Use `posn-set-point' to handle the case when a menu item |
| 865 | ;; is selected from the context menu that should describe KEY | 866 | ;; is selected from the context menu that should describe KEY |
| 866 | ;; at the position of mouse click that opened the context menu. | 867 | ;; at the position of mouse click that opened the context menu. |
| 867 | ;; When no mouse was involved, don't use `posn-set-point'. | 868 | ;; When no mouse was involved, or the event doesn't provide a |
| 868 | (defn (if buffer | 869 | ;; valid position, don't use `posn-set-point'. |
| 870 | (defn (if (or buffer (not (consp click-pos))) | ||
| 869 | (key-binding key t) | 871 | (key-binding key t) |
| 870 | (save-excursion (posn-set-point (event-end event)) | 872 | (save-excursion (posn-set-point (event-end event)) |
| 871 | (key-binding key t))))) | 873 | (key-binding key t))))) |
diff --git a/lisp/subr.el b/lisp/subr.el index 21f43092d42..dc219a49a74 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1729,7 +1729,7 @@ and `event-end' functions." | |||
| 1729 | ((eq area 'horizontal-scroll-bar) | 1729 | ((eq area 'horizontal-scroll-bar) |
| 1730 | (cons (scroll-bar-scale pair (window-width window)) 0)) | 1730 | (cons (scroll-bar-scale pair (window-width window)) 0)) |
| 1731 | (t | 1731 | (t |
| 1732 | (if use-window | 1732 | (if (and (windowp frame-or-window) use-window) |
| 1733 | (cons (/ (car pair) (window-font-width window)) | 1733 | (cons (/ (car pair) (window-font-width window)) |
| 1734 | (/ (cdr pair) (window-font-height window))) | 1734 | (/ (cdr pair) (window-font-height window))) |
| 1735 | ;; FIXME: This should take line-spacing properties on | 1735 | ;; FIXME: This should take line-spacing properties on |