diff options
| author | Eli Zaretskii | 2015-11-06 21:21:52 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-11-06 21:21:52 +0200 |
| commit | 19e09cfab61436cb4590303871a31ee07624f5ab (patch) | |
| tree | d3c2a351783b2d0a9c58e513c76b5c7cc58b082b | |
| parent | 8025fdbbea6eaaa3e1290864fe2dc48e2201df48 (diff) | |
| download | emacs-19e09cfab61436cb4590303871a31ee07624f5ab.tar.gz emacs-19e09cfab61436cb4590303871a31ee07624f5ab.zip | |
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.el | 7 | ||||
| -rw-r--r-- | lisp/progmodes/elisp-mode.el | 14 | ||||
| -rw-r--r-- | src/data.c | 1 | ||||
| -rw-r--r-- | src/window.h | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 14 |
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'." | |||
| 2231 | (make-obsolete-variable | 2231 | (make-obsolete-variable |
| 2232 | 'window-system-version "it does not give useful information." "24.3") | 2232 | 'window-system-version "it does not give useful information." "24.3") |
| 2233 | 2233 | ||
| 2234 | ;; These variables should trigger redisplay of the current buffer. | ||
| 2235 | (setq redisplay--variables | ||
| 2236 | '(line-spacing | ||
| 2237 | overline-margin | ||
| 2238 | line-prefix | ||
| 2239 | wrap-prefix)) | ||
| 2240 | |||
| 2234 | (provide 'frame) | 2241 | (provide 'frame) |
| 2235 | 2242 | ||
| 2236 | ;;; frame.el ends here | 2243 | ;;; 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 | |||
| 1116 | character)." | 1116 | character)." |
| 1117 | (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t))) | 1117 | (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t))) |
| 1118 | ;; Setup the lexical environment if lexical-binding is enabled. | 1118 | ;; Setup the lexical environment if lexical-binding is enabled. |
| 1119 | (prog1 | 1119 | (elisp--eval-last-sexp-print-value |
| 1120 | (elisp--eval-last-sexp-print-value | 1120 | (eval (eval-sexp-add-defvars (elisp--preceding-sexp)) lexical-binding) |
| 1121 | (eval (eval-sexp-add-defvars (elisp--preceding-sexp)) lexical-binding) | 1121 | eval-last-sexp-arg-internal))) |
| 1122 | eval-last-sexp-arg-internal) | ||
| 1123 | ;; If we are going to display the result in the echo area, force | ||
| 1124 | ;; a more thorough redisplay, in case the sexp we evaluated | ||
| 1125 | ;; changes something that should affect the display of the | ||
| 1126 | ;; current window. Otherwise, Emacs might decide that only the | ||
| 1127 | ;; echo area needs to be redisplayed. | ||
| 1128 | (if (eq standard-output t) | ||
| 1129 | (force-mode-line-update 'all))))) | ||
| 1130 | 1122 | ||
| 1131 | (defun elisp--eval-last-sexp-print-value (value &optional eval-last-sexp-arg-internal) | 1123 | (defun elisp--eval-last-sexp-print-value (value &optional eval-last-sexp-arg-internal) |
| 1132 | (let ((unabbreviated (let ((print-length nil) (print-level nil)) | 1124 | (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, | |||
| 1240 | return; | 1240 | return; |
| 1241 | } | 1241 | } |
| 1242 | 1242 | ||
| 1243 | maybe_set_redisplay (symbol); | ||
| 1243 | sym = XSYMBOL (symbol); | 1244 | sym = XSYMBOL (symbol); |
| 1244 | 1245 | ||
| 1245 | start: | 1246 | 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); | |||
| 1056 | extern void fset_redisplay (struct frame *f); | 1056 | extern void fset_redisplay (struct frame *f); |
| 1057 | extern void bset_redisplay (struct buffer *b); | 1057 | extern void bset_redisplay (struct buffer *b); |
| 1058 | extern void bset_update_mode_line (struct buffer *b); | 1058 | extern void bset_update_mode_line (struct buffer *b); |
| 1059 | extern void maybe_set_redisplay (Lisp_Object); | ||
| 1059 | /* Call this to tell redisplay to look for other windows than selected-window | 1060 | /* Call this to tell redisplay to look for other windows than selected-window |
| 1060 | that need to be redisplayed. Calling one of the *set_redisplay functions | 1061 | that need to be redisplayed. Calling one of the *set_redisplay functions |
| 1061 | above already does it, so it's only needed in unusual cases. */ | 1062 | 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) | |||
| 620 | b->text->redisplay = true; | 620 | b->text->redisplay = true; |
| 621 | } | 621 | } |
| 622 | 622 | ||
| 623 | void | ||
| 624 | maybe_set_redisplay (Lisp_Object symbol) | ||
| 625 | { | ||
| 626 | if (!NILP (Fassoc_string (symbol, Vredisplay__variables, Qnil))) | ||
| 627 | { | ||
| 628 | bset_update_mode_line (current_buffer); | ||
| 629 | current_buffer->prevent_redisplay_optimizations_p = true; | ||
| 630 | } | ||
| 631 | } | ||
| 632 | |||
| 623 | #ifdef GLYPH_DEBUG | 633 | #ifdef GLYPH_DEBUG |
| 624 | 634 | ||
| 625 | /* True means print traces of redisplay if compiled with | 635 | /* True means print traces of redisplay if compiled with |
| @@ -31465,6 +31475,10 @@ display table takes effect; in this case, Emacs does not consult | |||
| 31465 | DEFVAR_LISP ("redisplay--mode-lines-cause", Vredisplay__mode_lines_cause, | 31475 | DEFVAR_LISP ("redisplay--mode-lines-cause", Vredisplay__mode_lines_cause, |
| 31466 | doc: /* */); | 31476 | doc: /* */); |
| 31467 | Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL); | 31477 | Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL); |
| 31478 | |||
| 31479 | DEFVAR_LISP ("redisplay--variables", Vredisplay__variables, | ||
| 31480 | doc: /* A list of variables changes to which trigger a thorough redisplay. */); | ||
| 31481 | Vredisplay__variables = Qnil; | ||
| 31468 | } | 31482 | } |
| 31469 | 31483 | ||
| 31470 | 31484 | ||