Commit b38fc7f1 authored by Juri Linkov's avatar Juri Linkov
Browse files

(goto-history-element): Allow minibuffer-default to be

a list of default values accessible by typing M-n in the minibuffer.
parent 538a93d8
2007-10-22 Juri Linkov <juri@jurta.org>
* simple.el (goto-history-element): Allow minibuffer-default to be
a list of default values accessible by typing M-n in the minibuffer.
2007-10-21 Stefan Monnier <monnier@iro.umontreal.ca> 2007-10-21 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/byte-opt.el (byte-optimize-featurep): Fix paren typo. * emacs-lisp/byte-opt.el (byte-optimize-featurep): Fix paren typo.
......
...@@ -1295,7 +1295,11 @@ makes the search case-sensitive." ...@@ -1295,7 +1295,11 @@ makes the search case-sensitive."
"Puts element of the minibuffer history in the minibuffer. "Puts element of the minibuffer history in the minibuffer.
The argument NABS specifies the absolute history position." The argument NABS specifies the absolute history position."
(interactive "p") (interactive "p")
(let ((minimum (if minibuffer-default -1 0)) (let ((minimum (if minibuffer-default
(- (if (listp minibuffer-default)
(length minibuffer-default)
1))
0))
elt minibuffer-returned-to-present) elt minibuffer-returned-to-present)
(if (and (zerop minibuffer-history-position) (if (and (zerop minibuffer-history-position)
(null minibuffer-text-before-history)) (null minibuffer-text-before-history))
...@@ -1317,8 +1321,10 @@ The argument NABS specifies the absolute history position." ...@@ -1317,8 +1321,10 @@ The argument NABS specifies the absolute history position."
(goto-char (point-max)) (goto-char (point-max))
(delete-minibuffer-contents) (delete-minibuffer-contents)
(setq minibuffer-history-position nabs) (setq minibuffer-history-position nabs)
(cond ((= nabs -1) (cond ((< nabs 0)
(setq elt minibuffer-default)) (setq elt (if (listp minibuffer-default)
(nth (1- (abs nabs)) minibuffer-default)
minibuffer-default)))
((= nabs 0) ((= nabs 0)
(setq elt (or minibuffer-text-before-history "")) (setq elt (or minibuffer-text-before-history ""))
(setq minibuffer-returned-to-present t) (setq minibuffer-returned-to-present t)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment