comparison lisp/minibuf.el @ 284:558f606b08ae r21-0b40

Import from CVS: tag r21-0b40
author cvs
date Mon, 13 Aug 2007 10:34:13 +0200
parents 7df0dd720c89
children 57709be46d1b
comparison
equal deleted inserted replaced
283:fa3d41851a08 284:558f606b08ae
113 "Normal hook run just after exit from minibuffer.") 113 "Normal hook run just after exit from minibuffer.")
114 114
115 (defvar minibuffer-help-form nil 115 (defvar minibuffer-help-form nil
116 "Value that `help-form' takes on inside the minibuffer.") 116 "Value that `help-form' takes on inside the minibuffer.")
117 117
118 (defvar minibuffer-default nil
119 "Default value for minibuffer input.")
120
118 (defvar minibuffer-local-map 121 (defvar minibuffer-local-map
119 (let ((map (make-sparse-keymap 'minibuffer-local-map))) 122 (let ((map (make-sparse-keymap 'minibuffer-local-map)))
120 map) 123 map)
121 "Default keymap to use when reading from the minibuffer.") 124 "Default keymap to use when reading from the minibuffer.")
122 125
1288 (unless (zerop n) 1291 (unless (zerop n)
1289 (when (eq minibuffer-history-position 1292 (when (eq minibuffer-history-position
1290 initial-minibuffer-history-position) 1293 initial-minibuffer-history-position)
1291 (setq current-minibuffer-contents (buffer-string) 1294 (setq current-minibuffer-contents (buffer-string)
1292 current-minibuffer-point (point))) 1295 current-minibuffer-point (point)))
1293 (let ((narg (- minibuffer-history-position n))) 1296 (let ((narg (- minibuffer-history-position n))
1294 (cond ((< narg 0) 1297 (minimum (if minibuffer-default -1 0)))
1298 (cond ((< narg minimum)
1295 (error "No following item in %s" minibuffer-history-variable)) 1299 (error "No following item in %s" minibuffer-history-variable))
1296 ((> narg (length (symbol-value minibuffer-history-variable))) 1300 ((> narg (length (symbol-value minibuffer-history-variable)))
1297 (error "No preceding item in %s" minibuffer-history-variable))) 1301 (error "No preceding item in %s" minibuffer-history-variable)))
1298 (erase-buffer) 1302 (erase-buffer)
1299 (setq minibuffer-history-position narg) 1303 (setq minibuffer-history-position narg)
1300 (if (eq narg initial-minibuffer-history-position) 1304 (if (eq narg initial-minibuffer-history-position)
1301 (progn 1305 (progn
1302 (insert current-minibuffer-contents) 1306 (insert current-minibuffer-contents)
1303 (goto-char current-minibuffer-point)) 1307 (goto-char current-minibuffer-point))
1304 (let ((elt (nth (1- minibuffer-history-position) 1308 (let ((elt (if (>= narg 0)
1305 (symbol-value minibuffer-history-variable)))) 1309 (nth (1- minibuffer-history-position)
1310 (symbol-value minibuffer-history-variable))
1311 minibuffer-default)))
1306 (insert 1312 (insert
1307 (if (not (stringp elt)) 1313 (if (not (stringp elt))
1308 (let ((print-level nil)) 1314 (let ((print-level nil))
1309 (condition-case nil 1315 (condition-case nil
1310 (let ((print-readably t) 1316 (let ((print-readably t)