emacs-devel
[Top][All Lists]
Advanced

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

Re: font-lock-global-modes = nil doesn't work


From: Richard Stallman
Subject: Re: font-lock-global-modes = nil doesn't work
Date: Mon, 08 Oct 2007 14:03:27 -0400

Does this fix the bug?  (It might be equivalent to reverting the previous
change, but it's cleaner.)

*** font-core.el        26 Jul 2007 12:57:21 -0400      1.46
--- font-core.el        07 Oct 2007 19:21:42 -0400      
***************
*** 234,240 ****
  ;; hook is run, the major mode is in the process of being changed and we do 
not
  ;; know what the final major mode will be.  So, `font-lock-change-major-mode'
  ;; only (a) notes the name of the current buffer, and (b) adds our function
! ;; `turn-on-font-lock-if-enabled' to the hook variables
  ;; `after-change-major-mode-hook' and `post-command-hook' (for modes
  ;; that do not yet run `after-change-major-mode-hook').  By the time
  ;; the functions on the first of these hooks to be run are run, the new major
--- 234,240 ----
  ;; hook is run, the major mode is in the process of being changed and we do 
not
  ;; know what the final major mode will be.  So, `font-lock-change-major-mode'
  ;; only (a) notes the name of the current buffer, and (b) adds our function
! ;; `turn-on-font-lock-if-desired' to the hook variables
  ;; `after-change-major-mode-hook' and `post-command-hook' (for modes
  ;; that do not yet run `after-change-major-mode-hook').  By the time
  ;; the functions on the first of these hooks to be run are run, the new major
***************
*** 281,294 ****
                      (repeat :inline t (symbol :tag "mode"))))
    :group 'font-lock)
  
! (defun turn-on-font-lock-if-enabled ()
!   (unless (and (eq (car-safe font-lock-global-modes) 'not)
!              (memq major-mode (cdr font-lock-global-modes)))
      (let (inhibit-quit)
        (turn-on-font-lock))))
  
  (define-globalized-minor-mode global-font-lock-mode
!   font-lock-mode turn-on-font-lock-if-enabled
    :extra-args (dummy)
    :initialize 'custom-initialize-safe-default
    :init-value (not (or noninteractive emacs-basic-display))
--- 281,297 ----
                      (repeat :inline t (symbol :tag "mode"))))
    :group 'font-lock)
  
! (defun turn-on-font-lock-if-desired ()
!   (when (cond ((eq font-lock-global-modes t)
!              t)
!             ((eq (car-safe font-lock-global-modes) 'not)
!              (not (memq major-mode (cdr font-lock-global-modes))))
!             (t (memq major-mode (cdr font-lock-global-modes))))
      (let (inhibit-quit)
        (turn-on-font-lock))))
  
  (define-globalized-minor-mode global-font-lock-mode
!   font-lock-mode turn-on-font-lock-if-desired
    :extra-args (dummy)
    :initialize 'custom-initialize-safe-default
    :init-value (not (or noninteractive emacs-basic-display))




reply via email to

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