Guarantee that buffer-local variables are cached in the window before
authorChris Hanson <org/chris-hanson/cph>
Thu, 8 Sep 1994 01:28:53 +0000 (01:28 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 8 Sep 1994 01:28:53 +0000 (01:28 +0000)
any redisplay can happen.

v7/src/edwin/bufwin.scm
v7/src/edwin/bufwiu.scm

index a6849e78d41b0124692c94f95beda32cc974fafb..ffa6a0534a976b96b6a1b2fbacf85e4d038a186d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: bufwin.scm,v 1.301 1993/08/18 23:57:38 cph Exp $
+;;;    $Id: bufwin.scm,v 1.302 1994/09/08 01:28:47 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology
 ;;;
                              (group-modified-tick (%window-group window))))
 
 (define (%recache-window-buffer-local-variables! window)
-  (let ((buffer (%window-buffer window)))
-    (%set-window-truncate-lines?!
-     window
+  (let ((maybe-recache
+        (lambda (read write value)
+          (let ((value* (read window)))
+            (if (not (eqv? value value*))
+                (begin
+                  (%set-window-force-redraw?! window #t)
+                  (write window value))))))
+       (buffer (%window-buffer window)))
+    (maybe-recache
+     %window-truncate-lines?
+     %set-window-truncate-lines?!
      (or (variable-local-value buffer (ref-variable-object truncate-lines))
         (and (variable-local-value
               buffer
               (ref-variable-object truncate-partial-width-windows))
              (window-has-horizontal-neighbor? (window-superior window)))))
-    (%set-window-tab-width!
-     window
+    (maybe-recache
+     %window-tab-width
+     %set-window-tab-width!
      (variable-local-value buffer (ref-variable-object tab-width)))))
 \f
 ;;;; Buffer and Point
index 75ee6ee19d4871ee75ef6185966b01ab157c6959..9200ede9142a76b494123e2ca19980326a3095a6 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: bufwiu.scm,v 1.27 1994/08/25 00:59:18 cph Exp $
+;;;    $Id: bufwiu.scm,v 1.28 1994/09/08 01:28:53 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-94 Massachusetts Institute of Technology
 ;;;
 
 (define (update-outlines! window)
   (%guarantee-start-mark! window)
+  ;; This procedure sets FORCE-REDRAW? if any cached variable has changed.
+  (%recache-window-buffer-local-variables! window)
   (if (%window-force-redraw? window)
       (begin
        (%set-window-force-redraw?! window false)
-       ;; When one of the cached buffer-local variables is set, it
-       ;; sets the FORCE-REDRAW bit so that this code will run.
-       (%recache-window-buffer-local-variables! window)
        (preserve-nothing! window))
       (let ((start (%window-current-start-index window))
            (end (%window-current-end-index window)))