From 15df17964df385dbec2119d52fef8e5b368ee99d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 17 Jul 2022 14:30:43 -0400 Subject: [PATCH] * lisp/minibuffer.el (minibuffer-complete-history): Ensure a list of strings --- lisp/minibuffer.el | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index a598fe110f2..5389e0b9adb 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -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. -- 2.39.5