aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2007-10-22 00:17:55 +0000
committerJuri Linkov2007-10-22 00:17:55 +0000
commitb38fc7f11ade8c23edd9581b5ab2d3c062da6256 (patch)
tree9d69d3ff63c9b9832b8b3d7f181d93305ceafc39
parent538a93d8332e847c7e9e3b9b071f064297af38aa (diff)
downloademacs-b38fc7f11ade8c23edd9581b5ab2d3c062da6256.tar.gz
emacs-b38fc7f11ade8c23edd9581b5ab2d3c062da6256.zip
(goto-history-element): Allow minibuffer-default to be
a list of default values accessible by typing M-n in the minibuffer.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/simple.el12
2 files changed, 14 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ea696bf9358..f96e92a6150 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-10-22 Juri Linkov <juri@jurta.org>
2
3 * simple.el (goto-history-element): Allow minibuffer-default to be
4 a list of default values accessible by typing M-n in the minibuffer.
5
12007-10-21 Stefan Monnier <monnier@iro.umontreal.ca> 62007-10-21 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * emacs-lisp/byte-opt.el (byte-optimize-featurep): Fix paren typo. 8 * emacs-lisp/byte-opt.el (byte-optimize-featurep): Fix paren typo.
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."
1295 "Puts element of the minibuffer history in the minibuffer. 1295 "Puts element of the minibuffer history in the minibuffer.
1296The argument NABS specifies the absolute history position." 1296The argument NABS specifies the absolute history position."
1297 (interactive "p") 1297 (interactive "p")
1298 (let ((minimum (if minibuffer-default -1 0)) 1298 (let ((minimum (if minibuffer-default
1299 (- (if (listp minibuffer-default)
1300 (length minibuffer-default)
1301 1))
1302 0))
1299 elt minibuffer-returned-to-present) 1303 elt minibuffer-returned-to-present)
1300 (if (and (zerop minibuffer-history-position) 1304 (if (and (zerop minibuffer-history-position)
1301 (null minibuffer-text-before-history)) 1305 (null minibuffer-text-before-history))
@@ -1317,8 +1321,10 @@ The argument NABS specifies the absolute history position."
1317 (goto-char (point-max)) 1321 (goto-char (point-max))
1318 (delete-minibuffer-contents) 1322 (delete-minibuffer-contents)
1319 (setq minibuffer-history-position nabs) 1323 (setq minibuffer-history-position nabs)
1320 (cond ((= nabs -1) 1324 (cond ((< nabs 0)
1321 (setq elt minibuffer-default)) 1325 (setq elt (if (listp minibuffer-default)
1326 (nth (1- (abs nabs)) minibuffer-default)
1327 minibuffer-default)))
1322 ((= nabs 0) 1328 ((= nabs 0)
1323 (setq elt (or minibuffer-text-before-history "")) 1329 (setq elt (or minibuffer-text-before-history ""))
1324 (setq minibuffer-returned-to-present t) 1330 (setq minibuffer-returned-to-present t)