;;; font-lock.el --- Electric font lock mode
;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Author: Jamie Zawinski
we recommend setting `syntax-begin-function' instead.
This is normally set via `font-lock-defaults'.")
+(make-obsolete-variable 'font-lock-beginning-of-syntax-function
+ 'syntax-begin-function "23.3")
(defvar font-lock-mark-block-function nil
"*Non-nil means use this function to mark a block of text.
"Fontify the current buffer the way the function `font-lock-mode' would."
(interactive)
(font-lock-set-defaults)
- (let ((font-lock-verbose (or font-lock-verbose (interactive-p))))
+ (let ((font-lock-verbose (or font-lock-verbose
+ (called-interactively-p 'interactive))))
(funcall font-lock-fontify-buffer-function)))
(defun font-lock-unfontify-buffer ()
(defvar font-lock-set-defaults nil) ; Whether we have set up defaults.
-(defvar font-lock-mode-major-mode)
+(defun font-lock-refresh-defaults ()
+ "Restart fontification in current buffer after recomputing from defaults.
+Recompute fontification variables using `font-lock-defaults' (or,
+if nil, using `font-lock-defaults-alist') and
+`font-lock-maximum-decoration'. Then restart fontification.
+
+Use this function when you have changed any of the above
+variables directly.
+
+Note: This function will erase modifications done by
+`font-lock-add-keywords' or `font-lock-remove-keywords', but will
+preserve `hi-lock-mode' highlighting patterns."
+ (let ((hi-lock--inhibit-font-lock-hook t))
+ (font-lock-mode -1))
+ (kill-local-variable 'font-lock-set-defaults)
+ (font-lock-mode 1))
+
+(defvar font-lock-major-mode nil
+ "Major mode for which the font-lock settings have been setup.")
+(make-variable-buffer-local 'font-lock-major-mode)
+
(defun font-lock-set-defaults ()
"Set fontification defaults appropriately for this mode.
Sets various variables using `font-lock-defaults' (or, if nil, using
`font-lock-defaults-alist') and `font-lock-maximum-decoration'."
;; Set fontification defaults if not previously set for correct major mode.
(unless (and font-lock-set-defaults
- (eq font-lock-mode-major-mode major-mode))
- (setq font-lock-mode-major-mode major-mode)
+ (eq font-lock-major-mode major-mode))
+ (setq font-lock-major-mode major-mode)
(set (make-local-variable 'font-lock-set-defaults) t)
(make-local-variable 'font-lock-fontified)
(make-local-variable 'font-lock-multiline)
(defface font-lock-string-face
'((((class grayscale) (background light)) (:foreground "DimGray" :slant italic))
(((class grayscale) (background dark)) (:foreground "LightGray" :slant italic))
- (((class color) (min-colors 88) (background light)) (:foreground "RosyBrown"))
+ (((class color) (min-colors 88) (background light)) (:foreground "VioletRed4"))
(((class color) (min-colors 88) (background dark)) (:foreground "LightSalmon"))
(((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
(((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
(defface font-lock-builtin-face
'((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
(((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
- (((class color) (min-colors 88) (background light)) (:foreground "Orchid"))
+ (((class color) (min-colors 88) (background light)) (:foreground "MediumOrchid4"))
(((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue"))
(((class color) (min-colors 16) (background light)) (:foreground "Orchid"))
(((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue"))
(:foreground "Gray90" :weight bold :slant italic))
(((class grayscale) (background dark))
(:foreground "DimGray" :weight bold :slant italic))
- (((class color) (min-colors 88) (background light)) (:foreground "DarkGoldenrod"))
+ (((class color) (min-colors 88) (background light)) (:foreground "sienna"))
(((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod"))
(((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
(((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
(:foreground "LightGray" :weight bold :underline t))
(((class grayscale) (background dark))
(:foreground "Gray50" :weight bold :underline t))
- (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
+ (((class color) (min-colors 88) (background light)) (:foreground "dark cyan"))
(((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
(((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
(((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
"save-match-data" "save-current-buffer"
"unwind-protect" "condition-case" "track-mouse"
"eval-after-load" "eval-and-compile" "eval-when-compile"
- "eval-when" "eval-at-startup" "eval-next-after-load"
+ "eval-when" "eval-next-after-load"
"with-case-table" "with-category-table"
"with-current-buffer" "with-electric-help"
"with-local-quit" "with-no-warnings"
"restart-bind" "restart-case" "in-package"
"break" "ignore-errors"
"loop" "do" "do*" "dotimes" "dolist" "the" "locally"
- "proclaim" "declaim" "declare" "symbol-macrolet"
+ "proclaim" "declaim" "declare" "symbol-macrolet" "letf"
"lexical-let" "lexical-let*" "flet" "labels" "compiler-let"
"destructuring-bind" "macrolet" "tagbody" "block" "go"
"multiple-value-bind" "multiple-value-prog1"