X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/e1dbe924b53c541fdf238a5a722b7177d5c8760b..2958e5237c6ee57378f1b47217aafd0b21ec86ab:/lisp/font-core.el diff --git a/lisp/font-core.el b/lisp/font-core.el index a5de29520f..5dd6ad3a17 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -1,8 +1,8 @@ ;;; font-core.el --- Core interface to font-lock -;; Copyright (C) 1992-2011 Free Software Foundation, Inc. +;; Copyright (C) 1992-2015 Free Software Foundation, Inc. -;; Maintainer: FSF +;; Maintainer: emacs-devel@gnu.org ;; Keywords: languages, faces ;; Package: emacs @@ -138,6 +138,7 @@ The above is the default behavior of `font-lock-mode'; you may specify your own function which is called when `font-lock-mode' is toggled via `font-lock-function'. " nil nil nil + :after-hook (font-lock-initial-fontify) ;; Don't turn on Font Lock mode if we don't have a display (we're running a ;; batch job) or if the buffer is invisible (the name starts with a space). (when (or noninteractive (eq (aref (buffer-name) 0) ?\s)) @@ -191,13 +192,7 @@ this function onto `change-major-mode-hook'." ;; Only do hard work if the mode has specified stuff in ;; `font-lock-defaults'. - (when (or font-lock-defaults - (if (boundp 'font-lock-keywords) font-lock-keywords) - (and mode - (boundp 'font-lock-set-defaults) - font-lock-set-defaults - font-lock-major-mode - (not (eq font-lock-major-mode major-mode)))) + (when (font-lock-specified-p mode) (font-lock-mode-internal mode))) (defun turn-on-font-lock ()