]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/minibuffer.el (completion-in-region--single-word): Simplify
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 26 Jun 2021 16:29:52 +0000 (12:29 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 26 Jun 2021 16:29:52 +0000 (12:29 -0400)
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
lisp/minibuffer.el

index e106815817e63f705595a7139c65d0e83a204c3d..d24ea355a51df93b55721838a9fc0213690cdd65 100644 (file)
@@ -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.
index 157ed617b05afc159146d2c8bdcdbce75a8d8e6c..71a2177c9b1b0fe9ae84562e68a7f8ad04a9fa61 100644 (file)
@@ -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.")