]> code.delx.au - gnu-emacs/commitdiff
Ensure redisplay after "C-x C-e"
authorEli Zaretskii <eliz@gnu.org>
Fri, 6 Nov 2015 09:28:46 +0000 (11:28 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 6 Nov 2015 09:28:46 +0000 (11:28 +0200)
* lisp/progmodes/elisp-mode.el (elisp--eval-last-sexp): Make sure
redisplay happens to account for any side effects of the evaluated
sexp.  (Bug#21835)

lisp/progmodes/elisp-mode.el

index bdc304e0aa53f490b57bcc385dc20c29f40baf2d..daf5e41d288b1038c8330adc058d118ef7bf6902 100644 (file)
@@ -1116,10 +1116,17 @@ include additional formats for integers \(octal, hexadecimal, and
 character)."
   (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t)))
     ;; Setup the lexical environment if lexical-binding is enabled.
-    (elisp--eval-last-sexp-print-value
-     (eval (eval-sexp-add-defvars (elisp--preceding-sexp)) lexical-binding)
-     eval-last-sexp-arg-internal)))
-
+    (prog1
+        (elisp--eval-last-sexp-print-value
+         (eval (eval-sexp-add-defvars (elisp--preceding-sexp)) lexical-binding)
+         eval-last-sexp-arg-internal)
+      ;; If we are going to display the result in the echo area, force
+      ;; a more thorough redisplay, in case the sexp we evaluated
+      ;; changes something that should affect the display of the
+      ;; current window.  Otherwise, Emacs might decide that only the
+      ;; echo area needs to be redisplayed.
+      (if (eq standard-output t)
+          (force-mode-line-update 'all)))))
 
 (defun elisp--eval-last-sexp-print-value (value &optional eval-last-sexp-arg-internal)
   (let ((unabbreviated (let ((print-length nil) (print-level nil))