mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Merge from origin/emacs-28
0545c70c16(origin/emacs-28) ; * src/keyboard.c (readable_events): Ad...805ed8d318Fix todo-mode AOT test failures (bug#51308)8f42ff31f6Fix hi-lock AOT test failures (bug#51308)8002fcd4b9Fix socks test4540130312; Fix typo59df93e2dd* lisp/help.el (help--analyze-key): Add new arg BUFFER (bu...cb8b12b56dImprove docstrings and NEWS item of 'repeat-mode'06fe499614* lisp/tab-bar.el (tab-bar-menu-bar): New command (bug#512...8358da9c4cDisplay a tab bar item as sunken when appropriate29fdc65860Fix tab bar item highlight when a mouse click is dropped7236592668Refer to mouse-highlight from make-pointer-invisible docst...cf4394a397* etc/PROBLEMS: Add hex codepoint for NO-BREAK SPACE2d647e88faDescribe how to debug fontconfig issuesc916040921Adapt Tramp tests1bb14f93f1Convert ANSI color definitions in themes to use faces (e.g...8e7cd29712Revert "Revert back to using ESC as viper-ESC-key again"91d71b38a3Fix inset rectangle corners when sides aren't drawn (bug#5...5c1a575ef4Don't use color escape sequences in vc-git-expanded-log-entryd7f595cc89Code cleanup in tramp-tests.el548a5db611; etc/NEWS fix wording # Conflicts: # etc/NEWS
This commit is contained in:
commit
bd7b5f72a9
24 changed files with 344 additions and 176 deletions
37
lisp/help.el
37
lisp/help.el
|
|
@ -677,9 +677,11 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
|
|||
(defun help--binding-undefined-p (defn)
|
||||
(or (null defn) (integerp defn) (equal defn 'undefined)))
|
||||
|
||||
(defun help--analyze-key (key untranslated)
|
||||
(defun help--analyze-key (key untranslated &optional buffer)
|
||||
"Get information about KEY its corresponding UNTRANSLATED events.
|
||||
Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
|
||||
Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG).
|
||||
When BUFFER is nil, it defaults to the buffer displayed
|
||||
in the selected window."
|
||||
(if (numberp untranslated)
|
||||
(error "Missing `untranslated'!"))
|
||||
(let* ((event (when (> (length key) 0)
|
||||
|
|
@ -699,9 +701,8 @@ Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
|
|||
;; is selected from the context menu that should describe KEY
|
||||
;; at the position of mouse click that opened the context menu.
|
||||
;; When no mouse was involved, don't use `mouse-set-point'.
|
||||
(defn (if (consp event)
|
||||
(save-excursion (mouse-set-point event) (key-binding key t))
|
||||
(key-binding key t))))
|
||||
(defn (if buffer (key-binding key t)
|
||||
(save-excursion (mouse-set-point event) (key-binding key t)))))
|
||||
;; Handle the case where we faked an entry in "Select and Paste" menu.
|
||||
(when (and (eq defn nil)
|
||||
(stringp (aref key (1- (length key))))
|
||||
|
|
@ -731,7 +732,7 @@ Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
|
|||
;; If nothing left, then keep one (the last one).
|
||||
(last info-list)))
|
||||
|
||||
(defun describe-key-briefly (&optional key-list insert untranslated)
|
||||
(defun describe-key-briefly (&optional key-list insert buffer)
|
||||
"Print the name of the functions KEY-LIST invokes.
|
||||
KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where
|
||||
RAW-SEQ is the untranslated form of the key sequence SEQ.
|
||||
|
|
@ -739,8 +740,10 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
|
|||
|
||||
While reading KEY-LIST interactively, this command temporarily enables
|
||||
menu items or tool-bar buttons that are disabled to allow getting help
|
||||
on them."
|
||||
(declare (advertised-calling-convention (key-list &optional insert) "27.1"))
|
||||
on them.
|
||||
|
||||
BUFFER is the buffer in which to lookup those keys; it defaults to the
|
||||
current buffer."
|
||||
(interactive
|
||||
;; Ignore mouse movement events because it's too easy to miss the
|
||||
;; message while moving the mouse.
|
||||
|
|
@ -748,15 +751,13 @@ on them."
|
|||
`(,key-list ,current-prefix-arg)))
|
||||
(when (arrayp key-list)
|
||||
;; Old calling convention, changed
|
||||
(setq key-list (list (cons key-list
|
||||
(if (numberp untranslated)
|
||||
(this-single-command-raw-keys)
|
||||
untranslated)))))
|
||||
(let* ((info-list (mapcar (lambda (kr)
|
||||
(help--analyze-key (car kr) (cdr kr)))
|
||||
key-list))
|
||||
(msg (mapconcat #'car (help--filter-info-list info-list 1) "\n")))
|
||||
(if insert (insert msg) (message "%s" msg))))
|
||||
(setq key-list (list (cons key-list nil))))
|
||||
(with-current-buffer (if (buffer-live-p buffer) buffer (current-buffer))
|
||||
(let* ((info-list (mapcar (lambda (kr)
|
||||
(help--analyze-key (car kr) (cdr kr) buffer))
|
||||
key-list))
|
||||
(msg (mapconcat #'car (help--filter-info-list info-list 1) "\n")))
|
||||
(if insert (insert msg) (message "%s" msg)))))
|
||||
|
||||
(defun help--key-binding-keymap (key &optional accept-default no-remap position)
|
||||
"Return a keymap holding a binding for KEY within current keymaps.
|
||||
|
|
@ -916,7 +917,7 @@ current buffer."
|
|||
(mapcar (lambda (x)
|
||||
(pcase-let* ((`(,seq . ,raw-seq) x)
|
||||
(`(,brief-desc ,defn ,event ,_mouse-msg)
|
||||
(help--analyze-key seq raw-seq))
|
||||
(help--analyze-key seq raw-seq buffer))
|
||||
(locus
|
||||
(help--binding-locus
|
||||
seq (event-start event))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue