1
Fork 0
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...
805ed8d318 Fix todo-mode AOT test failures (bug#51308)
8f42ff31f6 Fix hi-lock AOT test failures (bug#51308)
8002fcd4b9 Fix socks test
4540130312 ; Fix typo
59df93e2dd * lisp/help.el (help--analyze-key): Add new arg BUFFER (bu...
cb8b12b56d Improve docstrings and NEWS item of 'repeat-mode'
06fe499614 * lisp/tab-bar.el (tab-bar-menu-bar): New command (bug#512...
8358da9c4c Display a tab bar item as sunken when appropriate
29fdc65860 Fix tab bar item highlight when a mouse click is dropped
7236592668 Refer to mouse-highlight from make-pointer-invisible docst...
cf4394a397 * etc/PROBLEMS: Add hex codepoint for NO-BREAK SPACE
2d647e88fa Describe how to debug fontconfig issues
c916040921 Adapt Tramp tests
1bb14f93f1 Convert ANSI color definitions in themes to use faces (e.g...
8e7cd29712 Revert "Revert back to using ESC as viper-ESC-key again"
91d71b38a3 Fix inset rectangle corners when sides aren't drawn (bug#5...
5c1a575ef4 Don't use color escape sequences in vc-git-expanded-log-entry
d7f595cc89 Code cleanup in tramp-tests.el
548a5db611 ; etc/NEWS fix wording

# Conflicts:
#	etc/NEWS
This commit is contained in:
Glenn Morris 2021-10-21 08:02:57 -07:00
commit bd7b5f72a9
24 changed files with 344 additions and 176 deletions

View file

@ -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))))