comparison lisp/simple.el @ 9629:53e092e189c6

(edit-and-eval-command): Elements of command-history are forms, not strings.
author Karl Heuer <kwzh@gnu.org>
date Thu, 20 Oct 1994 20:14:45 +0000
parents d3f3f3db986d
children b2157de450ca
comparison
equal deleted inserted replaced
9628:d325ca3a67e4 9629:53e092e189c6
402 the minibuffer, then read and evaluate the result." 402 the minibuffer, then read and evaluate the result."
403 (let ((command (read-from-minibuffer prompt 403 (let ((command (read-from-minibuffer prompt
404 (prin1-to-string command) 404 (prin1-to-string command)
405 read-expression-map t 405 read-expression-map t
406 '(command-history . 1)))) 406 '(command-history . 1))))
407 ;; If command was added to command-history as a string,
408 ;; get rid of that. We want only evallable expressions there.
409 (if (stringp (car command-history))
410 (setq command-history (cdr command-history)))
411
412 ;; If command to be redone does not match front of history,
413 ;; add it to the history.
414 (or (equal command (car command-history))
415 (setq command-history (cons command command-history)))
407 (eval command))) 416 (eval command)))
408 417
409 (defun repeat-complex-command (arg) 418 (defun repeat-complex-command (arg)
410 "Edit and re-evaluate last complex command, or ARGth from last. 419 "Edit and re-evaluate last complex command, or ARGth from last.
411 A complex command is one which used the minibuffer. 420 A complex command is one which used the minibuffer.