emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 29c360e: Ensure redisplay after "C-x C-e"


From: Eli Zaretskii
Subject: [Emacs-diffs] master 29c360e: Ensure redisplay after "C-x C-e"
Date: Fri, 06 Nov 2015 09:30:11 +0000

branch: master
commit 29c360ee1cb0ba68470d831739d4df33016fada1
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Ensure redisplay after "C-x C-e"
    
    * 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 |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index bdc304e..daf5e41 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]