diff lisp/font-core.el @ 109008:646e914bd0fd

* lisp/font-lock.el (font-lock-major-mode): Rename from font-lock-mode-major-mode to distinguish it from global-font-lock-mode's own font-lock-mode-major-mode. (font-lock-set-defaults): * lisp/font-core.el (font-lock-default-function): Adjust users. (font-lock-mode): Don't set it at all.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 16 Jun 2010 16:00:22 -0400
parents 1d1d5d9bd884
children 280c8ae2476d 376148b31b5e
line wrap: on
line diff
--- a/lisp/font-core.el	Tue Jun 15 13:41:21 2010 +0200
+++ b/lisp/font-core.el	Wed Jun 16 16:00:22 2010 -0400
@@ -97,7 +97,7 @@
 `font-lock-mode'.")
 
 ;; The mode for which font-lock was initialized, or nil if none.
-(defvar font-lock-mode-major-mode)
+(defvar font-lock-major-mode)
 (define-minor-mode font-lock-mode
   "Toggle Font Lock mode.
 With arg, turn Font Lock mode off if and only if arg is a non-positive
@@ -159,9 +159,7 @@
   ;; Arrange to unfontify this buffer if we change major mode later.
   (if font-lock-mode
       (add-hook 'change-major-mode-hook 'font-lock-change-mode nil t)
-    (remove-hook 'change-major-mode-hook 'font-lock-change-mode t))
-  (when font-lock-mode
-    (setq font-lock-mode-major-mode major-mode)))
+    (remove-hook 'change-major-mode-hook 'font-lock-change-mode t)))
 
 ;; Get rid of fontification for the old major mode.
 ;; We do this when changing major modes.
@@ -213,8 +211,8 @@
 	    (and mode
 		 (boundp 'font-lock-set-defaults)
 		 font-lock-set-defaults
-		 font-lock-mode-major-mode
-		 (not (eq font-lock-mode-major-mode major-mode))))
+		 font-lock-major-mode
+		 (not (eq font-lock-major-mode major-mode))))
     (font-lock-mode-internal mode)))
 
 (defun turn-on-font-lock ()