Fix "C-h k" in xterm-mouse-mode
* lisp/help.el (help-read-key-sequence): Support "C-h k" for xterm-mouse-mode by calling read-key-sequence-vector instead of read-event. (Bug#29150)
This commit is contained in:
parent
05aa6d4a68
commit
44340b475f
1 changed files with 10 additions and 6 deletions
16
lisp/help.el
16
lisp/help.el
|
@ -717,7 +717,7 @@ with `mouse-movement' events."
|
||||||
(cursor-in-echo-area t)
|
(cursor-in-echo-area t)
|
||||||
saved-yank-menu)
|
saved-yank-menu)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(let (key)
|
(let (key down-ev)
|
||||||
;; If yank-menu is empty, populate it temporarily, so that
|
;; If yank-menu is empty, populate it temporarily, so that
|
||||||
;; "Select and Paste" menu can generate a complete event.
|
;; "Select and Paste" menu can generate a complete event.
|
||||||
(when (null (cdr yank-menu))
|
(when (null (cdr yank-menu))
|
||||||
|
@ -743,17 +743,21 @@ Describe the following key, mouse click, or menu item: "))
|
||||||
(let ((last-idx (1- (length key))))
|
(let ((last-idx (1- (length key))))
|
||||||
(and (eventp (aref key last-idx))
|
(and (eventp (aref key last-idx))
|
||||||
(memq 'down (event-modifiers (aref key last-idx)))))
|
(memq 'down (event-modifiers (aref key last-idx)))))
|
||||||
(or (and (eventp (aref key 0))
|
(or (and (eventp (setq down-ev (aref key 0)))
|
||||||
(memq 'down (event-modifiers (aref key 0)))
|
(memq 'down (event-modifiers down-ev))
|
||||||
;; However, for the C-down-mouse-2 popup
|
;; However, for the C-down-mouse-2 popup
|
||||||
;; menu, there is no subsequent up-event. In
|
;; menu, there is no subsequent up-event. In
|
||||||
;; this case, the up-event is the next
|
;; this case, the up-event is the next
|
||||||
;; element in the supplied vector.
|
;; element in the supplied vector.
|
||||||
(= (length key) 1))
|
(= (length key) 1))
|
||||||
(and (> (length key) 1)
|
(and (> (length key) 1)
|
||||||
(eventp (aref key 1))
|
(eventp (setq down-ev (aref key 1)))
|
||||||
(memq 'down (event-modifiers (aref key 1)))))
|
(memq 'down (event-modifiers down-ev))))
|
||||||
(read-event))))
|
(if (and (terminal-parameter nil 'xterm-mouse-mode)
|
||||||
|
(equal (terminal-parameter nil 'xterm-mouse-last-down)
|
||||||
|
down-ev))
|
||||||
|
(aref (read-key-sequence-vector nil) 0)
|
||||||
|
(read-event)))))
|
||||||
;; Put yank-menu back as it was, if we changed it.
|
;; Put yank-menu back as it was, if we changed it.
|
||||||
(when saved-yank-menu
|
(when saved-yank-menu
|
||||||
(setq yank-menu (copy-sequence saved-yank-menu))
|
(setq yank-menu (copy-sequence saved-yank-menu))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue