Subject: Re: bug#16808: 24.3.50; an error when completing M-x ... commands.

From: Nicolas Richard <[email-masked]>
Date: Mon, 24 Feb 2014 16:03:13 +0100

Stefan Monnier <[email-masked]> writes:

>>> -	  (when (and (= 1 (length comps) (consp (car comps))))
>>> +	  (when (and (= 1 (length comps)) (consp (car comps)))
>> (= 1 (length comps)) would be better written as (not (cdr comps)) in
>> this context.
>
> Both look good, please install,

FWIW I'm unable to do that. If there's anything I can do to make
someone's life easier for installing I'll be happy to do so. Meanwhile,
here's an updated patch:

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index edc4c95..7f98005 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1371,7 +1371,7 @@ appear to be a match."
 				   (concat before ext after)
 				   table predicate (1+ point) md))
 				exts))))
-	  (when (and (= 1 (length comps) (consp (car comps))))
+	  (when (and (null (cdr comps)) (consp (car comps)))
 	    (setq comp (car comps)))))
 
       ;; Completing a single word is actually more difficult than completing
@@ -1451,7 +1451,7 @@ Return nil if there is no valid completion, else t."
         (minibuffer-completion-predicate predicate))
     (pcase (completion--do-completion beg end
                                       #'completion--try-word-completion)
-    (#b000 nil)
+      (#b000 nil)
       (_     t))))
 
 (defface completions-annotations '((t :inherit italic))

-- 
Nico.