diff options
| author | Stefan Monnier | 2008-02-12 16:49:21 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-02-12 16:49:21 +0000 |
| commit | 558ca3c1225f6035442733d5d3fb5fd4c40a0a45 (patch) | |
| tree | 4e62817bb69a8b8d581a916f34d2cc95ff940f2c | |
| parent | 9787268671ebbdea9f731468af84406390cd40c3 (diff) | |
| download | emacs-558ca3c1225f6035442733d5d3fb5fd4c40a0a45.tar.gz emacs-558ca3c1225f6035442733d5d3fb5fd4c40a0a45.zip | |
(font-lock-set-defaults): Unset previously set variables when needed.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/font-lock.el | 18 |
2 files changed, 16 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5b368112454..49706f3c0aa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-02-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * font-lock.el (font-lock-set-defaults): Unset previously set variables | ||
| 4 | when needed. | ||
| 5 | |||
| 1 | 2008-02-12 Juanma Barranquero <lekktu@gmail.com> | 6 | 2008-02-12 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * uniquify.el (uniquify-buffer-base-name): New function. | 8 | * uniquify.el (uniquify-buffer-base-name): New function. |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 8fcd85515a4..0408d12b5d1 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1777,13 +1777,16 @@ Sets various variables using `font-lock-defaults' (or, if nil, using | |||
| 1777 | (cdr-safe (assq major-mode font-lock-removed-keywords-alist)))) | 1777 | (cdr-safe (assq major-mode font-lock-removed-keywords-alist)))) |
| 1778 | (set (make-local-variable 'font-lock-defaults) defaults) | 1778 | (set (make-local-variable 'font-lock-defaults) defaults) |
| 1779 | ;; Syntactic fontification? | 1779 | ;; Syntactic fontification? |
| 1780 | (when (nth 1 defaults) | 1780 | (if (nth 1 defaults) |
| 1781 | (set (make-local-variable 'font-lock-keywords-only) t)) | 1781 | (set (make-local-variable 'font-lock-keywords-only) t) |
| 1782 | (kill-local-variable 'font-lock-keywords-only)) | ||
| 1782 | ;; Case fold during regexp fontification? | 1783 | ;; Case fold during regexp fontification? |
| 1783 | (when (nth 2 defaults) | 1784 | (if (nth 2 defaults) |
| 1784 | (set (make-local-variable 'font-lock-keywords-case-fold-search) t)) | 1785 | (set (make-local-variable 'font-lock-keywords-case-fold-search) t) |
| 1786 | (kill-local-variable 'font-lock-keywords-case-fold-search)) | ||
| 1785 | ;; Syntax table for regexp and syntactic fontification? | 1787 | ;; Syntax table for regexp and syntactic fontification? |
| 1786 | (when (nth 3 defaults) | 1788 | (if (null (nth 3 defaults)) |
| 1789 | (kill-local-variable 'font-lock-syntax-table) | ||
| 1787 | (set (make-local-variable 'font-lock-syntax-table) | 1790 | (set (make-local-variable 'font-lock-syntax-table) |
| 1788 | (copy-syntax-table (syntax-table))) | 1791 | (copy-syntax-table (syntax-table))) |
| 1789 | (dolist (selem (nth 3 defaults)) | 1792 | (dolist (selem (nth 3 defaults)) |
| @@ -1794,9 +1797,10 @@ Sets various variables using `font-lock-defaults' (or, if nil, using | |||
| 1794 | (mapcar 'identity (car selem)))) | 1797 | (mapcar 'identity (car selem)))) |
| 1795 | (modify-syntax-entry char syntax font-lock-syntax-table))))) | 1798 | (modify-syntax-entry char syntax font-lock-syntax-table))))) |
| 1796 | ;; Syntax function for syntactic fontification? | 1799 | ;; Syntax function for syntactic fontification? |
| 1797 | (when (nth 4 defaults) | 1800 | (if (nth 4 defaults) |
| 1798 | (set (make-local-variable 'font-lock-beginning-of-syntax-function) | 1801 | (set (make-local-variable 'font-lock-beginning-of-syntax-function) |
| 1799 | (nth 4 defaults))) | 1802 | (nth 4 defaults)) |
| 1803 | (kill-local-variable 'font-lock-beginning-of-syntax-function)) | ||
| 1800 | ;; Variable alist? | 1804 | ;; Variable alist? |
| 1801 | (dolist (x (nthcdr 5 defaults)) | 1805 | (dolist (x (nthcdr 5 defaults)) |
| 1802 | (set (make-local-variable (car x)) (cdr x))) | 1806 | (set (make-local-variable (car x)) (cdr x))) |