;;; -*-Scheme-*-
;;;
-;;; $Id: buffer.scm,v 1.174 2000/02/07 23:09:41 cph Exp $
+;;; $Id: buffer.scm,v 1.175 2000/02/29 04:07:07 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
;;;
(window-modeline-event! (car windows) type)
(loop (cdr windows))))))
-
(define (without-editor-interrupts thunk)
;; Control interrupts whether or not in the editor.
;; WITH-EDITOR-INTERRUPTS-DISABLED is required in the running editor but
(with-editor-interrupts-disabled thunk)
(without-interrupts thunk)))
-
(define (buffer-reset! buffer)
(set-buffer-writable! buffer)
(buffer-widen! buffer)
(set-variable-default-value! variable value))))
(define (set-variable-default-value! variable value)
- (let ((value (normalize-variable-value variable value)))
- (without-editor-interrupts
- (lambda ()
- (set-variable-%default-value! variable value)
- (if (not (search-local-bindings (current-buffer) variable))
- (set-variable-%value! variable value))
- (invoke-variable-assignment-daemons! #f variable)))))
+ (if within-editor?
+ (let ((value (normalize-variable-value variable value)))
+ (without-editor-interrupts
+ (lambda ()
+ (set-variable-%default-value! variable value)
+ (if (not (search-local-bindings (current-buffer) variable))
+ (set-variable-%value! variable value))
+ (invoke-variable-assignment-daemons! #f variable))))
+ (set-default-variable-value!/outside-editor variable value)))
(define-integrable (search-local-bindings buffer variable)
(let loop ((bindings (buffer-local-bindings buffer)))
(define (set-variable-value! variable value)
(if within-editor?
(set-variable-local-value! (current-buffer) variable value)
- (begin
- (let ((value (normalize-variable-value variable value)))
- (without-interrupts
- ;; Not with-editor-interrupts-disabled as we are not within-editor?
- (lambda ()
- (set-variable-%default-value! variable value)
- (set-variable-%value! variable value)
- (invoke-variable-assignment-daemons! #f variable)))))))
+ (set-default-variable-value!/outside-editor variable value)))
+
+(define (set-default-variable-value!/outside-editor variable value)
+ (let ((value (normalize-variable-value variable value)))
+ (without-interrupts
+ ;; Not with-editor-interrupts-disabled as we are not within-editor?
+ (lambda ()
+ (set-variable-%default-value! variable value)
+ (set-variable-%value! variable value)
+ (invoke-variable-assignment-daemons! #f variable)))))
(define (with-variable-value! variable new-value thunk)
(let ((old-value))
(%set-buffer-major-mode! buffer mode)
(buffer-modeline-event! buffer 'BUFFER-MODES))))
-
(define (%set-buffer-major-mode! buffer mode)
(set-buffer-modes! buffer (list mode))
(set-buffer-comtabs! buffer (mode-comtabs mode))