diff options
| author | Stefan Monnier | 2013-02-15 18:47:50 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2013-02-15 18:47:50 -0500 |
| commit | 6c8f113e705fe7f58695fdeda04aaa6a9c9b8a93 (patch) | |
| tree | 0d7174d28d1e55f4b101ab25c5ef26024f77a4ae | |
| parent | f852f6d8c0db494ccb21b6020a5ebbeaa685a948 (diff) | |
| download | emacs-6c8f113e705fe7f58695fdeda04aaa6a9c9b8a93.tar.gz emacs-6c8f113e705fe7f58695fdeda04aaa6a9c9b8a93.zip | |
* lisp/simple.el (eval-expression): Let `exp' set the mark.
Fixes: debbugs:13724
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/simple.el | 16 |
2 files changed, 18 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 99704a0b532..064ad686fca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,11 +1,15 @@ | |||
| 1 | 2013-02-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * simple.el (eval-expression): Let `exp' set the mark (bug#13724). | ||
| 4 | |||
| 1 | 2013-02-15 Alan Mackenzie <acm@muc.de> | 5 | 2013-02-15 Alan Mackenzie <acm@muc.de> |
| 2 | 6 | ||
| 3 | * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a | 7 | * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a |
| 4 | global minor mode has been enabled, call the minor mode function | 8 | global minor mode has been enabled, call the minor mode function |
| 5 | for a new buffer once only, after the major mode hook, whilst | 9 | for a new buffer once only, after the major mode hook, whilst |
| 6 | allowing that hook explicitly to disable the minor mode. | 10 | allowing that hook explicitly to disable the minor mode. |
| 7 | (MODE-disable-in-buffer): new (generated) function. | 11 | (MODE-disable-in-buffer): New (generated) function. |
| 8 | (disable-MODE): new (generated) buffer local variable. | 12 | (disable-MODE): New (generated) buffer local variable. |
| 9 | 13 | ||
| 10 | 2013-02-15 Jambunathan K <kjambunathan@gmail.com> | 14 | 2013-02-15 Jambunathan K <kjambunathan@gmail.com> |
| 11 | 15 | ||
| @@ -52,8 +56,8 @@ | |||
| 52 | 56 | ||
| 53 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> | 57 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> |
| 54 | 58 | ||
| 55 | * net/tramp.el (tramp-debug-message): Add | 59 | * net/tramp.el (tramp-debug-message): |
| 56 | `tramp-condition-case-unless-debug'. | 60 | Add `tramp-condition-case-unless-debug'. |
| 57 | (tramp-debug-on-error): New defvar. | 61 | (tramp-debug-on-error): New defvar. |
| 58 | (tramp-condition-case-unless-debug): New defun. | 62 | (tramp-condition-case-unless-debug): New defun. |
| 59 | (tramp-file-name-handler): Use it. | 63 | (tramp-file-name-handler): Use it. |
| @@ -207,8 +211,8 @@ | |||
| 207 | * net/tramp-compat.el (top): Declare `remote-file-name-inhibit-cache' | 211 | * net/tramp-compat.el (top): Declare `remote-file-name-inhibit-cache' |
| 208 | only if it doesn't exist. | 212 | only if it doesn't exist. |
| 209 | 213 | ||
| 210 | * net/tramp-sh.el (tramp-sh-handle-start-file-process): Set | 214 | * net/tramp-sh.el (tramp-sh-handle-start-file-process): |
| 211 | process marker. | 215 | Set process marker. |
| 212 | 216 | ||
| 213 | 2013-02-12 Tassilo Horn <tsdh@gnu.org> | 217 | 2013-02-12 Tassilo Horn <tsdh@gnu.org> |
| 214 | 218 | ||
diff --git a/lisp/simple.el b/lisp/simple.el index 849f7dac55c..138c2420309 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1293,13 +1293,12 @@ display the result of expression evaluation." | |||
| 1293 | 1293 | ||
| 1294 | ;; We define this, rather than making `eval' interactive, | 1294 | ;; We define this, rather than making `eval' interactive, |
| 1295 | ;; for the sake of completion of names like eval-region, eval-buffer. | 1295 | ;; for the sake of completion of names like eval-region, eval-buffer. |
| 1296 | (defun eval-expression (eval-expression-arg | 1296 | (defun eval-expression (exp &optional insert-value) |
| 1297 | &optional eval-expression-insert-value) | 1297 | "Evaluate EXP and print value in the echo area. |
| 1298 | "Evaluate EVAL-EXPRESSION-ARG and print value in the echo area. | ||
| 1299 | When called interactively, read an Emacs Lisp expression and | 1298 | When called interactively, read an Emacs Lisp expression and |
| 1300 | evaluate it. | 1299 | evaluate it. |
| 1301 | Value is also consed on to front of the variable `values'. | 1300 | Value is also consed on to front of the variable `values'. |
| 1302 | Optional argument EVAL-EXPRESSION-INSERT-VALUE non-nil (interactively, | 1301 | Optional argument INSERT-VALUE non-nil (interactively, |
| 1303 | with prefix argument) means insert the result into the current buffer | 1302 | with prefix argument) means insert the result into the current buffer |
| 1304 | instead of printing it in the echo area. Truncates long output | 1303 | instead of printing it in the echo area. Truncates long output |
| 1305 | according to the value of the variables `eval-expression-print-length' | 1304 | according to the value of the variables `eval-expression-print-length' |
| @@ -1315,12 +1314,12 @@ this command arranges for all errors to enter the debugger." | |||
| 1315 | current-prefix-arg)) | 1314 | current-prefix-arg)) |
| 1316 | 1315 | ||
| 1317 | (if (null eval-expression-debug-on-error) | 1316 | (if (null eval-expression-debug-on-error) |
| 1318 | (push (eval eval-expression-arg lexical-binding) values) | 1317 | (push (eval exp lexical-binding) values) |
| 1319 | (let ((old-value (make-symbol "t")) new-value) | 1318 | (let ((old-value (make-symbol "t")) new-value) |
| 1320 | ;; Bind debug-on-error to something unique so that we can | 1319 | ;; Bind debug-on-error to something unique so that we can |
| 1321 | ;; detect when evalled code changes it. | 1320 | ;; detect when evalled code changes it. |
| 1322 | (let ((debug-on-error old-value)) | 1321 | (let ((debug-on-error old-value)) |
| 1323 | (push (eval eval-expression-arg lexical-binding) values) | 1322 | (push (eval exp lexical-binding) values) |
| 1324 | (setq new-value debug-on-error)) | 1323 | (setq new-value debug-on-error)) |
| 1325 | ;; If evalled code has changed the value of debug-on-error, | 1324 | ;; If evalled code has changed the value of debug-on-error, |
| 1326 | ;; propagate that change to the global binding. | 1325 | ;; propagate that change to the global binding. |
| @@ -1328,8 +1327,9 @@ this command arranges for all errors to enter the debugger." | |||
| 1328 | (setq debug-on-error new-value)))) | 1327 | (setq debug-on-error new-value)))) |
| 1329 | 1328 | ||
| 1330 | (let ((print-length eval-expression-print-length) | 1329 | (let ((print-length eval-expression-print-length) |
| 1331 | (print-level eval-expression-print-level)) | 1330 | (print-level eval-expression-print-level) |
| 1332 | (if eval-expression-insert-value | 1331 | (deactivate-mark)) |
| 1332 | (if insert-value | ||
| 1333 | (with-no-warnings | 1333 | (with-no-warnings |
| 1334 | (let ((standard-output (current-buffer))) | 1334 | (let ((standard-output (current-buffer))) |
| 1335 | (prin1 (car values)))) | 1335 | (prin1 (car values)))) |