[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 60185819b6 1/2: * lisp/minibuffer.el (minibuffer-complete-history
From: |
Juri Linkov |
Subject: |
master 60185819b6 1/2: * lisp/minibuffer.el (minibuffer-complete-history): Check for history=t. |
Date: |
Sun, 17 Jul 2022 14:07:30 -0400 (EDT) |
branch: master
commit 60185819b62e1c06161c93ebdc1dc73e7813604b
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>
* lisp/minibuffer.el (minibuffer-complete-history): Check for history=t.
Signal a user error when the history is not a list (bug#56613).
---
lisp/minibuffer.el | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 9d2abbd118..a598fe110f 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -4409,11 +4409,14 @@ Like `minibuffer-complete' but completes on the history
items
instead of the default completion table."
(interactive)
(let ((completions-sort nil)
- (history (mapcar (lambda (h)
- ;; Support e.g. `C-x ESC ESC TAB' as
- ;; a replacement of `list-command-history'
- (if (consp h) (format "%S" h) h))
- (symbol-value minibuffer-history-variable))))
+ (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"))
(completion-in-region (minibuffer--completion-prompt-end) (point-max)
history nil)))