[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 185759e 1/2: Fix `M-X TAB' completion for commands marked for mul
From: |
Lars Ingebrigtsen |
Subject: |
master 185759e 1/2: Fix `M-X TAB' completion for commands marked for multiple modes |
Date: |
Fri, 27 Aug 2021 12:41:50 -0400 (EDT) |
branch: master
commit 185759e07adc9acda25eff7e1d551619cfba874b
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Fix `M-X TAB' completion for commands marked for multiple modes
* lisp/simple.el (command-completion-using-modes-p): Fix
completion over commands that are defined for multiple modes
(bug#50228).
---
lisp/simple.el | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index db083cf..d6c448b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2070,7 +2070,7 @@ This function uses the `read-extended-command-predicate'
user option."
"Say whether SYMBOL has been marked as a mode-specific command in BUFFER."
;; Check the modes.
(let ((modes (command-modes symbol)))
- ;; Common case: Just a single mode.
+ ;; Common fast case: Just a single mode.
(if (null (cdr modes))
(or (provided-mode-derived-p
(buffer-local-value 'major-mode buffer) (car modes))
@@ -2078,13 +2078,7 @@ This function uses the `read-extended-command-predicate'
user option."
(buffer-local-value 'local-minor-modes buffer))
(memq (car modes) global-minor-modes))
;; Uncommon case: Multiple modes.
- (apply #'provided-mode-derived-p
- (buffer-local-value 'major-mode buffer)
- modes)
- (seq-intersection modes
- (buffer-local-value 'local-minor-modes buffer)
- #'eq)
- (seq-intersection modes global-minor-modes #'eq))))
+ (command-completion-with-modes-p modes buffer))))
(defun command-completion-default-include-p (symbol buffer)
"Say whether SYMBOL should be offered as a completion.