]> code.delx.au - gnu-emacs/blobdiff - lisp/font-core.el
w32-fns.el (w32-convert-standard-filename): Doc fix.
[gnu-emacs] / lisp / font-core.el
index be3a2a3eacaa360af582be9901ed260a3c962359..d33295b3c34a3edb15e56845b068cc738fd47741 100644 (file)
@@ -97,7 +97,7 @@ It will be passed one argument, which is the current value of
 `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 @@ your own function which is called when `font-lock-mode' is toggled via
   ;; 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 @@ this function onto `change-major-mode-hook'."
            (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 ()