summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-11-06 21:21:52 +0200
committerEli Zaretskii <eliz@gnu.org>2015-11-06 21:21:52 +0200
commit19e09cfab61436cb4590303871a31ee07624f5ab (patch)
treed3c2a351783b2d0a9c58e513c76b5c7cc58b082b
parent8025fdbbea6eaaa3e1290864fe2dc48e2201df48 (diff)
downloademacs-19e09cfab61436cb4590303871a31ee07624f5ab.tar.gz
Ensure redisplay after evaluation
* lisp/progmodes/elisp-mode.el (elisp--eval-last-sexp): Revert last change. * lisp/frame.el (redisplay--variables): Populate the redisplay--variables list. * src/xdisp.c (maybe_set_redisplay): New function. (syms_of_xdisp) <redisplay--variables>: New variable. * src/window.h (maybe_set_redisplay): Declare prototype. * src/data.c (set_internal): Call maybe_set_redisplay. (Bug#21835)
-rw-r--r--lisp/frame.el7
-rw-r--r--lisp/progmodes/elisp-mode.el14
-rw-r--r--src/data.c1
-rw-r--r--src/window.h1
-rw-r--r--src/xdisp.c14
5 files changed, 26 insertions, 11 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index f5508517dc6..4b23cb20ac4 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2231,6 +2231,13 @@ See also `toggle-frame-maximized'."
(make-obsolete-variable
'window-system-version "it does not give useful information." "24.3")
+;; These variables should trigger redisplay of the current buffer.
+(setq redisplay--variables
+ '(line-spacing
+ overline-margin
+ line-prefix
+ wrap-prefix))
+
(provide 'frame)
;;; frame.el ends here
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index daf5e41d288..8ea17b74ddb 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1116,17 +1116,9 @@ 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.
- (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)))))
+ (elisp--eval-last-sexp-print-value
+ (eval (eval-sexp-add-defvars (elisp--preceding-sexp)) lexical-binding)
+ eval-last-sexp-arg-internal)))
(defun elisp--eval-last-sexp-print-value (value &optional eval-last-sexp-arg-internal)
(let ((unabbreviated (let ((print-length nil) (print-level nil))
diff --git a/src/data.c b/src/data.c
index 5382b01066e..4db93f5625f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1240,6 +1240,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where,
return;
}
+ maybe_set_redisplay (symbol);
sym = XSYMBOL (symbol);
start:
diff --git a/src/window.h b/src/window.h
index eaff57eaedf..135f5de7d8a 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1056,6 +1056,7 @@ extern void wset_redisplay (struct window *w);
extern void fset_redisplay (struct frame *f);
extern void bset_redisplay (struct buffer *b);
extern void bset_update_mode_line (struct buffer *b);
+extern void maybe_set_redisplay (Lisp_Object);
/* Call this to tell redisplay to look for other windows than selected-window
that need to be redisplayed. Calling one of the *set_redisplay functions
above already does it, so it's only needed in unusual cases. */
diff --git a/src/xdisp.c b/src/xdisp.c
index bdf2d09179e..f6d63ea702f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -620,6 +620,16 @@ bset_update_mode_line (struct buffer *b)
b->text->redisplay = true;
}
+void
+maybe_set_redisplay (Lisp_Object symbol)
+{
+ if (!NILP (Fassoc_string (symbol, Vredisplay__variables, Qnil)))
+ {
+ bset_update_mode_line (current_buffer);
+ current_buffer->prevent_redisplay_optimizations_p = true;
+ }
+}
+
#ifdef GLYPH_DEBUG
/* True means print traces of redisplay if compiled with
@@ -31465,6 +31475,10 @@ display table takes effect; in this case, Emacs does not consult
DEFVAR_LISP ("redisplay--mode-lines-cause", Vredisplay__mode_lines_cause,
doc: /* */);
Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL);
+
+ DEFVAR_LISP ("redisplay--variables", Vredisplay__variables,
+ doc: /* A list of variables changes to which trigger a thorough redisplay. */);
+ Vredisplay__variables = Qnil;
}