diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/simple.el | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index a9a262cee16..8babd63b47d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -382,9 +382,11 @@ Other major modes are defined by comparison with this one." | |||
| 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 (list (read-from-minibuffer "Eval: " | 385 | (interactive |
| 386 | nil read-expression-map t | 386 | (let* ((minibuffer-history-sexp-flag t)) |
| 387 | 'read-expression-history))) | 387 | (list (read-from-minibuffer "Eval: " |
| 388 | nil read-expression-map t | ||
| 389 | 'read-expression-history))) | ||
| 388 | (setq values (cons (eval expression) values)) | 390 | (setq values (cons (eval expression) values)) |
| 389 | (prin1 (car values) t)) | 391 | (prin1 (car values) t)) |
| 390 | 392 | ||
| @@ -392,15 +394,11 @@ Value is also consed on to front of the variable `values'." | |||
| 392 | "Prompting with PROMPT, let user edit COMMAND and eval result. | 394 | "Prompting with PROMPT, let user edit COMMAND and eval result. |
| 393 | COMMAND is a Lisp expression. Let user edit that expression in | 395 | COMMAND is a Lisp expression. Let user edit that expression in |
| 394 | the minibuffer, then read and evaluate the result." | 396 | the minibuffer, then read and evaluate the result." |
| 395 | (let ((command (read-from-minibuffer prompt | 397 | (let* ((minibuffer-history-sexp-flag t) |
| 396 | (prin1-to-string command) | 398 | (command (read-from-minibuffer prompt |
| 397 | read-expression-map t | 399 | (prin1-to-string command) |
| 398 | '(command-history . 1)))) | 400 | read-expression-map t |
| 399 | ;;; Don't add the command to the history; read-from-minibuffer has | 401 | '(command-history . 1)))) |
| 400 | ;;; already done that. | ||
| 401 | ;;; ;; Add edited command to command history, unless redundant. | ||
| 402 | ;;; (or (equal command (car command-history)) | ||
| 403 | ;;; (setq command-history (cons command command-history))) | ||
| 404 | (eval command))) | 402 | (eval command))) |
| 405 | 403 | ||
| 406 | (defun repeat-complex-command (arg) | 404 | (defun repeat-complex-command (arg) |