diff options
author | Juri Linkov <juri@jurta.org> | 2007-10-22 00:17:55 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2007-10-22 00:17:55 +0000 |
commit | b38fc7f11ade8c23edd9581b5ab2d3c062da6256 (patch) | |
tree | 9d69d3ff63c9b9832b8b3d7f181d93305ceafc39 /lisp/simple.el | |
parent | 538a93d8332e847c7e9e3b9b071f064297af38aa (diff) | |
download | emacs-b38fc7f11ade8c23edd9581b5ab2d3c062da6256.tar.gz |
(goto-history-element): Allow minibuffer-default to be
a list of default values accessible by typing M-n in the minibuffer.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r-- | lisp/simple.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index ebf0a5ff71e..eb76cd490d4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1295,7 +1295,11 @@ makes the search case-sensitive." "Puts element of the minibuffer history in the minibuffer. The argument NABS specifies the absolute history position." (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) (if (and (zerop minibuffer-history-position) (null minibuffer-text-before-history)) @@ -1317,8 +1321,10 @@ The argument NABS specifies the absolute history position." (goto-char (point-max)) (delete-minibuffer-contents) (setq minibuffer-history-position nabs) - (cond ((= nabs -1) - (setq elt minibuffer-default)) + (cond ((< nabs 0) + (setq elt (if (listp minibuffer-default) + (nth (1- (abs nabs)) minibuffer-default) + minibuffer-default))) ((= nabs 0) (setq elt (or minibuffer-text-before-history "")) (setq minibuffer-returned-to-present t) |