[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b8f9e58: * lisp/minibuffer.el (completion-in-region--single-word)
From: |
Stefan Monnier |
Subject: |
master b8f9e58: * lisp/minibuffer.el (completion-in-region--single-word): Simplify |
Date: |
Sat, 26 Jun 2021 12:29:56 -0400 (EDT) |
branch: master
commit b8f9e58ef72402e69a1f0960816184d52e5d2d29
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* lisp/minibuffer.el (completion-in-region--single-word): Simplify
Remove redundant args `collection` and `predicate` which were always
equal to `minibuffer-completion-table` and
`minibuffer-completion-predicate` anyway.
(minibuffer-complete-word):
* lisp/emacs-lisp/crm.el (crm-complete-word): Simplify accordingly.
---
lisp/emacs-lisp/crm.el | 3 +--
lisp/minibuffer.el | 15 +++++----------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index e106815..d24ea35 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -183,8 +183,7 @@ Return t if the current element is now a valid match;
otherwise return nil."
Like `minibuffer-complete-word' but for `completing-read-multiple'."
(interactive)
(crm--completion-command beg end
- (completion-in-region--single-word
- beg end minibuffer-completion-table minibuffer-completion-predicate)))
+ (completion-in-region--single-word beg end)))
(defun crm-complete-and-exit ()
"If all of the minibuffer elements are valid completions then exit.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 157ed61..71a2177 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1790,17 +1790,12 @@ is added, provided that matches some possible
completion.
Return nil if there is no valid completion, else t."
(interactive)
(completion-in-region--single-word
- (minibuffer--completion-prompt-end) (point-max)
- minibuffer-completion-table minibuffer-completion-predicate))
-
-(defun completion-in-region--single-word (beg end collection
- &optional predicate)
- (let ((minibuffer-completion-table collection)
- (minibuffer-completion-predicate predicate))
- (pcase (completion--do-completion beg end
- #'completion--try-word-completion)
+ (minibuffer--completion-prompt-end) (point-max)))
+
+(defun completion-in-region--single-word (beg end)
+ (pcase (completion--do-completion beg end #'completion--try-word-completion)
(#b000 nil)
- (_ t))))
+ (_ t)))
(defface completions-annotations '((t :inherit (italic shadow)))
"Face to use for annotations in the *Completions* buffer.")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master b8f9e58: * lisp/minibuffer.el (completion-in-region--single-word): Simplify,
Stefan Monnier <=