diff options
| author | Glenn Morris | 2010-10-05 21:14:05 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-10-05 21:14:05 -0700 |
| commit | 6aecca9993f9f1c6209c40e4019bc90cb0ce0abb (patch) | |
| tree | fca334ed1d6ece6d49669dd87e45146c230cb1cd /lisp | |
| parent | 645a6257c4fdb1cb8bf963d9681cf5eb7a13aa70 (diff) | |
| download | emacs-6aecca9993f9f1c6209c40e4019bc90cb0ce0abb.tar.gz emacs-6aecca9993f9f1c6209c40e4019bc90cb0ce0abb.zip | |
Remove obsolete variable font-lock-defaults-alist.
* lisp/font-core.el (font-lock-defaults-alist): Remove variable.
(font-lock-mode): Doc fix.
(font-lock-default-function): Do not consult font-lock-defaults-alist.
* lisp/font-lock.el (font-lock-refresh-defaults): Doc fix.
(font-lock-set-defaults): Doc fix.
Do not consult font-lock-defaults-alist.
* etc/NEWS: Mention above change.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/font-core.el | 17 | ||||
| -rw-r--r-- | lisp/font-lock.el | 29 |
3 files changed, 19 insertions, 34 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5de5380925b..bf1ce5f9676 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2010-10-06 Glenn Morris <rgm@gnu.org> | 1 | 2010-10-06 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * font-core.el (font-lock-defaults-alist): Remove variable. | ||
| 4 | (font-lock-mode): Doc fix. | ||
| 5 | (font-lock-default-function): Do not consult font-lock-defaults-alist. | ||
| 6 | * font-lock.el (font-lock-refresh-defaults): Doc fix. | ||
| 7 | (font-lock-set-defaults): Doc fix. | ||
| 8 | Do not consult font-lock-defaults-alist. | ||
| 9 | |||
| 3 | * hilit-chg.el (hilit-chg-get-diff-list-hk): Declare `e' for compiler. | 10 | * hilit-chg.el (hilit-chg-get-diff-list-hk): Declare `e' for compiler. |
| 4 | 11 | ||
| 5 | * emacs-lisp/cl.el: No longer provide cl-19. | 12 | * emacs-lisp/cl.el: No longer provide cl-19. |
diff --git a/lisp/font-core.el b/lisp/font-core.el index a8b72539d5d..5f8af5a5215 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el | |||
| @@ -81,17 +81,6 @@ functions, `font-lock-fontify-buffer-function', | |||
| 81 | (put 'font-lock-defaults 'risky-local-variable t) | 81 | (put 'font-lock-defaults 'risky-local-variable t) |
| 82 | (make-variable-buffer-local 'font-lock-defaults) | 82 | (make-variable-buffer-local 'font-lock-defaults) |
| 83 | 83 | ||
| 84 | (defvar font-lock-defaults-alist nil | ||
| 85 | "Alist of fall-back Font Lock defaults for major modes. | ||
| 86 | |||
| 87 | Each item should be a list of the form: | ||
| 88 | |||
| 89 | (MAJOR-MODE . FONT-LOCK-DEFAULTS) | ||
| 90 | |||
| 91 | where MAJOR-MODE is a symbol and FONT-LOCK-DEFAULTS is a list of default | ||
| 92 | settings. See the variable `font-lock-defaults', which takes precedence.") | ||
| 93 | (make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults "21.1") | ||
| 94 | |||
| 95 | (defvar font-lock-function 'font-lock-default-function | 84 | (defvar font-lock-function 'font-lock-default-function |
| 96 | "A function which is called when `font-lock-mode' is toggled. | 85 | "A function which is called when `font-lock-mode' is toggled. |
| 97 | It will be passed one argument, which is the current value of | 86 | It will be passed one argument, which is the current value of |
| @@ -144,8 +133,7 @@ To fontify a block (the function or paragraph containing point, or a number of | |||
| 144 | lines around point), perhaps because modification on the current line caused | 133 | lines around point), perhaps because modification on the current line caused |
| 145 | syntactic change on other lines, you can use \\[font-lock-fontify-block]. | 134 | syntactic change on other lines, you can use \\[font-lock-fontify-block]. |
| 146 | 135 | ||
| 147 | See the variable `font-lock-defaults-alist' for the Font Lock mode default | 136 | You can set your own default settings for some mode, by setting a |
| 148 | settings. You can set your own default settings for some mode, by setting a | ||
| 149 | buffer local value for `font-lock-defaults', via its mode hook. | 137 | buffer local value for `font-lock-defaults', via its mode hook. |
| 150 | 138 | ||
| 151 | The above is the default behavior of `font-lock-mode'; you may specify | 139 | The above is the default behavior of `font-lock-mode'; you may specify |
| @@ -207,8 +195,6 @@ this function onto `change-major-mode-hook'." | |||
| 207 | ;; `font-lock-defaults'. | 195 | ;; `font-lock-defaults'. |
| 208 | (when (or font-lock-defaults | 196 | (when (or font-lock-defaults |
| 209 | (if (boundp 'font-lock-keywords) font-lock-keywords) | 197 | (if (boundp 'font-lock-keywords) font-lock-keywords) |
| 210 | (with-no-warnings | ||
| 211 | (cdr (assq major-mode font-lock-defaults-alist))) | ||
| 212 | (and mode | 198 | (and mode |
| 213 | (boundp 'font-lock-set-defaults) | 199 | (boundp 'font-lock-set-defaults) |
| 214 | font-lock-set-defaults | 200 | font-lock-set-defaults |
| @@ -310,5 +296,4 @@ means that Font Lock mode is turned on for buffers in C and C++ modes only." | |||
| 310 | 296 | ||
| 311 | (provide 'font-core) | 297 | (provide 'font-core) |
| 312 | 298 | ||
| 313 | ;; arch-tag: f8c286e1-02f7-41d9-b89b-1b67780aed71 | ||
| 314 | ;;; font-core.el ends here | 299 | ;;; font-core.el ends here |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 6c316f5f958..fe873297dc2 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | ;;; font-lock.el --- Electric font lock mode | 1 | ;;; font-lock.el --- Electric font lock mode |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 3 | ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 4 | ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | 4 | ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, |
| 5 | ;; Free Software Foundation, Inc. | 5 | ;; 2010 Free Software Foundation, Inc. |
| 6 | 6 | ||
| 7 | ;; Author: Jamie Zawinski | 7 | ;; Author: Jamie Zawinski |
| 8 | ;; Richard Stallman | 8 | ;; Richard Stallman |
| @@ -102,11 +102,10 @@ | |||
| 102 | 102 | ||
| 103 | ;; Modes that support Font Lock mode do so by defining one or more variables | 103 | ;; Modes that support Font Lock mode do so by defining one or more variables |
| 104 | ;; whose values specify the fontification. Font Lock mode knows of these | 104 | ;; whose values specify the fontification. Font Lock mode knows of these |
| 105 | ;; variable names from (a) the buffer local variable `font-lock-defaults', if | 105 | ;; variable names from the buffer local variable `font-lock-defaults'. |
| 106 | ;; non-nil, or (b) the global variable `font-lock-defaults-alist', if the major | 106 | ;; (Font Lock mode is set up via (a) where a mode's patterns are |
| 107 | ;; mode has an entry. (Font Lock mode is set up via (a) where a mode's | 107 | ;; distributed with the mode's package library, and (b) where a mode's |
| 108 | ;; patterns are distributed with the mode's package library, and (b) where a | 108 | ;; patterns are distributed with font-lock.el itself. An example of (a) |
| 109 | ;; mode's patterns are distributed with font-lock.el itself. An example of (a) | ||
| 110 | ;; is Pascal mode, an example of (b) is Lisp mode. Normally, the mechanism is | 109 | ;; is Pascal mode, an example of (b) is Lisp mode. Normally, the mechanism is |
| 111 | ;; (a); (b) is used where it is not clear which package library should contain | 110 | ;; (a); (b) is used where it is not clear which package library should contain |
| 112 | ;; the pattern definitions.) Font Lock mode chooses which variable to use for | 111 | ;; the pattern definitions.) Font Lock mode chooses which variable to use for |
| @@ -1758,8 +1757,7 @@ A LEVEL of nil is equal to a LEVEL of 0, a LEVEL of t is equal to | |||
| 1758 | 1757 | ||
| 1759 | (defun font-lock-refresh-defaults () | 1758 | (defun font-lock-refresh-defaults () |
| 1760 | "Restart fontification in current buffer after recomputing from defaults. | 1759 | "Restart fontification in current buffer after recomputing from defaults. |
| 1761 | Recompute fontification variables using `font-lock-defaults' (or, | 1760 | Recompute fontification variables using `font-lock-defaults' and |
| 1762 | if nil, using `font-lock-defaults-alist') and | ||
| 1763 | `font-lock-maximum-decoration'. Then restart fontification. | 1761 | `font-lock-maximum-decoration'. Then restart fontification. |
| 1764 | 1762 | ||
| 1765 | Use this function when you have changed any of the above | 1763 | Use this function when you have changed any of the above |
| @@ -1779,8 +1777,8 @@ preserve `hi-lock-mode' highlighting patterns." | |||
| 1779 | 1777 | ||
| 1780 | (defun font-lock-set-defaults () | 1778 | (defun font-lock-set-defaults () |
| 1781 | "Set fontification defaults appropriately for this mode. | 1779 | "Set fontification defaults appropriately for this mode. |
| 1782 | Sets various variables using `font-lock-defaults' (or, if nil, using | 1780 | Sets various variables using `font-lock-defaults' and |
| 1783 | `font-lock-defaults-alist') and `font-lock-maximum-decoration'." | 1781 | `font-lock-maximum-decoration'." |
| 1784 | ;; Set fontification defaults if not previously set for correct major mode. | 1782 | ;; Set fontification defaults if not previously set for correct major mode. |
| 1785 | (unless (and font-lock-set-defaults | 1783 | (unless (and font-lock-set-defaults |
| 1786 | (eq font-lock-major-mode major-mode)) | 1784 | (eq font-lock-major-mode major-mode)) |
| @@ -1788,10 +1786,7 @@ Sets various variables using `font-lock-defaults' (or, if nil, using | |||
| 1788 | (set (make-local-variable 'font-lock-set-defaults) t) | 1786 | (set (make-local-variable 'font-lock-set-defaults) t) |
| 1789 | (make-local-variable 'font-lock-fontified) | 1787 | (make-local-variable 'font-lock-fontified) |
| 1790 | (make-local-variable 'font-lock-multiline) | 1788 | (make-local-variable 'font-lock-multiline) |
| 1791 | (let* ((defaults (or font-lock-defaults | 1789 | (let* ((defaults font-lock-defaults) |
| 1792 | (cdr (assq major-mode | ||
| 1793 | (with-no-warnings | ||
| 1794 | font-lock-defaults-alist))))) | ||
| 1795 | (keywords | 1790 | (keywords |
| 1796 | (font-lock-choose-keywords (nth 0 defaults) | 1791 | (font-lock-choose-keywords (nth 0 defaults) |
| 1797 | (font-lock-value-in-major-mode font-lock-maximum-decoration))) | 1792 | (font-lock-value-in-major-mode font-lock-maximum-decoration))) |
| @@ -2082,8 +2077,7 @@ Sets various variables using `font-lock-defaults' (or, if nil, using | |||
| 2082 | ;; ;; Activate less/more fontification entries if there are multiple levels for | 2077 | ;; ;; Activate less/more fontification entries if there are multiple levels for |
| 2083 | ;; ;; the current buffer. Sets `font-lock-fontify-level' to be of the form | 2078 | ;; ;; the current buffer. Sets `font-lock-fontify-level' to be of the form |
| 2084 | ;; ;; (CURRENT-LEVEL IS-LOWER-LEVEL-P IS-HIGHER-LEVEL-P) for menu activation. | 2079 | ;; ;; (CURRENT-LEVEL IS-LOWER-LEVEL-P IS-HIGHER-LEVEL-P) for menu activation. |
| 2085 | ;; (let ((keywords (or (nth 0 font-lock-defaults) | 2080 | ;; (let ((keywords (nth 0 font-lock-defaults)) |
| 2086 | ;; (nth 1 (assq major-mode font-lock-defaults-alist)))) | ||
| 2087 | ;; (level (font-lock-value-in-major-mode font-lock-maximum-decoration))) | 2081 | ;; (level (font-lock-value-in-major-mode font-lock-maximum-decoration))) |
| 2088 | ;; (make-local-variable 'font-lock-fontify-level) | 2082 | ;; (make-local-variable 'font-lock-fontify-level) |
| 2089 | ;; (if (or (symbolp keywords) (= (length keywords) 1)) | 2083 | ;; (if (or (symbolp keywords) (= (length keywords) 1)) |
| @@ -2353,5 +2347,4 @@ in which C preprocessor directives are used. e.g. `asm-mode' and | |||
| 2353 | 2347 | ||
| 2354 | (provide 'font-lock) | 2348 | (provide 'font-lock) |
| 2355 | 2349 | ||
| 2356 | ;; arch-tag: 682327e4-64d8-4057-b20b-1fbb9f1fc54c | ||
| 2357 | ;;; font-lock.el ends here | 2350 | ;;; font-lock.el ends here |