comparison lisp/simple.el @ 5068:9a42f23df119

(eval-expression): Don't bind minibuffer-history-sexp-flag. (edit-and-eval-command): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Fri, 19 Nov 1993 17:43:24 +0000
parents 1574c6c6561f
children b8731641d26a
comparison
equal deleted inserted replaced
5067:4854aff5c5b3 5068:9a42f23df119
381 ;; for the sake of completion of names like eval-region, eval-current-buffer. 381 ;; for the sake of completion of names like eval-region, eval-current-buffer.
382 (defun eval-expression (expression) 382 (defun eval-expression (expression)
383 "Evaluate EXPRESSION and print value in minibuffer. 383 "Evaluate EXPRESSION and print value in minibuffer.
384 Value is also consed on to front of the variable `values'." 384 Value is also consed on to front of the variable `values'."
385 (interactive 385 (interactive
386 (let* ((minibuffer-history-sexp-flag t)) 386 (list (read-from-minibuffer "Eval: "
387 (list (read-from-minibuffer "Eval: " 387 nil read-expression-map t
388 nil read-expression-map t 388 'read-expression-history)))
389 'read-expression-history))))
390 (setq values (cons (eval expression) values)) 389 (setq values (cons (eval expression) values))
391 (prin1 (car values) t)) 390 (prin1 (car values) t))
392 391
393 (defun edit-and-eval-command (prompt command) 392 (defun edit-and-eval-command (prompt command)
394 "Prompting with PROMPT, let user edit COMMAND and eval result. 393 "Prompting with PROMPT, let user edit COMMAND and eval result.
395 COMMAND is a Lisp expression. Let user edit that expression in 394 COMMAND is a Lisp expression. Let user edit that expression in
396 the minibuffer, then read and evaluate the result." 395 the minibuffer, then read and evaluate the result."
397 (let* ((minibuffer-history-sexp-flag t) 396 (let ((command (read-from-minibuffer prompt
398 (command (read-from-minibuffer prompt 397 (prin1-to-string command)
399 (prin1-to-string command) 398 read-expression-map t
400 read-expression-map t 399 '(command-history . 1))))
401 '(command-history . 1))))
402 (eval command))) 400 (eval command)))
403 401
404 (defun repeat-complex-command (arg) 402 (defun repeat-complex-command (arg)
405 "Edit and re-evaluate last complex command, or ARGth from last. 403 "Edit and re-evaluate last complex command, or ARGth from last.
406 A complex command is one which used the minibuffer. 404 A complex command is one which used the minibuffer.