]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/minibuffer.el (minibuffer-complete-history): Ensure a list of strings
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 17 Jul 2022 18:30:43 +0000 (14:30 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 17 Jul 2022 18:30:43 +0000 (14:30 -0400)
lisp/minibuffer.el

index a598fe110f26278bac640eb72289ef862043f8b9..5389e0b9adb8b85b4de2a8c3a738876942d3d46c 100644 (file)
@@ -4408,17 +4408,19 @@ minibuffer, but don't quit the completions window."
 Like `minibuffer-complete' but completes on the history items
 instead of the default completion table."
   (interactive)
-  (let ((completions-sort nil)
-        (history (symbol-value minibuffer-history-variable)))
-    (if (listp history)
-        ;; Support e.g. `C-x ESC ESC TAB' as
-        ;; a replacement of `list-command-history'
-        (setq history (mapcar (lambda (h)
-                                (if (consp h) (format "%S" h) h))
-                              history))
-      (user-error "No history available"))
+  (let* ((completions-sort nil)
+         (history (symbol-value minibuffer-history-variable))
+         (completions
+          (if (listp history)
+              ;; Support e.g. `C-x ESC ESC TAB' as
+              ;; a replacement of `list-command-history'
+              (mapcar (lambda (h)
+                        (if (stringp h) h (format "%S" h)))
+                      history)
+            (user-error "No history available"))))
+    ;; FIXME: Can we make it work for CRM?
     (completion-in-region (minibuffer--completion-prompt-end) (point-max)
-                          history nil)))
+                          completions nil)))
 
 (defun minibuffer-complete-defaults ()
   "Complete minibuffer defaults as far as possible.