summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorYuuki Harano <masm+github@masm11.me>2020-12-21 01:53:07 +0900
committerYuuki Harano <masm+github@masm11.me>2020-12-21 01:53:07 +0900
commit565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42 (patch)
tree5a25406b9f4ff091cb6856e857d2857bb3e631e4 /lisp/simple.el
parenta44cd7c88121bb0e04bdf13d73e15f085cf3b085 (diff)
parent87b82a1969edf80d3bd4781454ec9fc968773a6d (diff)
downloademacs-565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42.tar.gz
emacs-565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42.tar.bz2
emacs-565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el32
1 files changed, 19 insertions, 13 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 9787ad1a072..4b425cf8d71 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1958,22 +1958,27 @@ to get different commands to edit and resubmit."
(lambda (string pred action)
(if (and suggest-key-bindings (eq action 'metadata))
'(metadata
- (annotation-function . read-extended-command--annotation)
+ (affixation-function . read-extended-command--affixation)
(category . command))
(complete-with-action action obarray string pred)))
#'commandp t nil 'extended-command-history)))
-(defun read-extended-command--annotation (command-name)
- (let* ((fun (and (stringp command-name) (intern-soft command-name)))
- (binding (where-is-internal fun overriding-local-map t))
- (obsolete (get fun 'byte-obsolete-info))
- (alias (symbol-function fun)))
- (cond ((symbolp alias)
- (format " (%s)" alias))
- (obsolete
- (format " (%s)" (car obsolete)))
- ((and binding (not (stringp binding)))
- (format " (%s)" (key-description binding))))))
+(defun read-extended-command--affixation (command-names)
+ (with-selected-window (or (minibuffer-selected-window) (selected-window))
+ (mapcar
+ (lambda (command-name)
+ (let* ((fun (and (stringp command-name) (intern-soft command-name)))
+ (binding (where-is-internal fun overriding-local-map t))
+ (obsolete (get fun 'byte-obsolete-info))
+ (alias (symbol-function fun))
+ (suffix (cond ((symbolp alias)
+ (format " (%s)" alias))
+ (obsolete
+ (format " (%s)" (car obsolete)))
+ ((and binding (not (stringp binding)))
+ (format " (%s)" (key-description binding))))))
+ (if suffix (list command-name suffix) command-name)))
+ command-names)))
(defcustom suggest-key-bindings t
"Non-nil means show the equivalent key-binding when M-x command has one.
@@ -2195,7 +2200,8 @@ in this use of the minibuffer.")
"Minibuffer history variables for which matching should ignore case.
If a history variable is a member of this list, then the
\\[previous-matching-history-element] and \\[next-matching-history-element]\
- commands ignore case when searching it, regardless of `case-fold-search'."
+ commands ignore case when searching it,
+regardless of `case-fold-search'."
:type '(repeat variable)
:group 'minibuffer)