Mercurial > emacs
changeset 60870:92071f8a7671
(generic-font-lock-defaults): Make it obsolete.
(generic-font-lock-keywords): New variable to replace
generic-font-lock-defaults.
(generic-mode-set-font-lock): Delete it.
(generic-mode-internal): Don't call generic-mode-set-font-lock.
(generic-bracket-support): Add docstring.
author | Lute Kamstra <lute@gnu.org> |
---|---|
date | Thu, 24 Mar 2005 09:01:37 +0000 |
parents | 88ef15014617 |
children | 71c0984fa6d6 |
files | lisp/generic.el |
diffstat | 1 files changed, 14 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/generic.el Thu Mar 24 03:25:40 2005 +0000 +++ b/lisp/generic.el Thu Mar 24 09:01:37 2005 +0000 @@ -125,9 +125,11 @@ ;; Internal Variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defvar generic-font-lock-defaults nil - "Global defaults for font-lock in a generic mode.") -(make-variable-buffer-local 'generic-font-lock-defaults) +(defvar generic-font-lock-keywords nil + "Keywords for `font-lock-defaults' in a generic mode.") +(make-variable-buffer-local 'generic-font-lock-keywords) +(defvaralias 'generic-font-lock-defaults 'generic-font-lock-keywords) +(make-obsolete-variable 'generic-font-lock-defaults 'generic-font-lock-keywords "22.1") ;;;###autoload (defvar generic-mode-list nil @@ -253,13 +255,15 @@ (generic-mode-set-comments comments) - ;; Font-lock functionality - ;; Font-lock-defaults are always set even if there are no keywords + ;; Font-lock functionality. + ;; Font-lock-defaults is always set even if there are no keywords ;; or font-lock expressions, so comments can be highlighted. - (setq generic-font-lock-defaults nil) - (generic-mode-set-font-lock keywords font-lock-list) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults (list 'generic-font-lock-defaults nil)) + (setq generic-font-lock-keywords + (append + (when keywords + (list (generic-make-keywords-list keywords font-lock-keyword-face))) + font-lock-list)) + (setq font-lock-defaults '(generic-font-lock-keywords nil)) ;; Call a list of functions (mapcar 'funcall funs) @@ -348,16 +352,8 @@ st)) (set-syntax-table st))) -(defun generic-mode-set-font-lock (keywords font-lock-expressions) - "Set up font-lock functionality for generic mode." - (setq generic-font-lock-defaults - (append - (when keywords - (list (generic-make-keywords-list keywords font-lock-keyword-face))) - font-lock-expressions))) - -;; Support for [KEYWORD] constructs found in INF, INI and Samba files (defun generic-bracket-support () + "Imenu support for [KEYWORD] constructs found in INF, INI and Samba files." (setq imenu-generic-expression '((nil "^\\[\\(.*\\)\\]" 1)) imenu-case-fold-search t))