Mercurial > emacs
comparison lisp/emacs-lisp/lisp-mode.el @ 99432:9241443c239d
(lisp-mode-variables): Add new argument
to initialize font-lock keyword case sensitivity.
(lisp-mode): Use it.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Fri, 07 Nov 2008 06:30:17 +0000 |
parents | 8e62d2d05a4e |
children | 3564a29838cf |
comparison
equal
deleted
inserted
replaced
99431:fe571ea62851 | 99432:9241443c239d |
---|---|
191 (= (point) (nth 8 state))))) | 191 (= (point) (nth 8 state))))) |
192 font-lock-doc-face | 192 font-lock-doc-face |
193 font-lock-string-face)))) | 193 font-lock-string-face)))) |
194 font-lock-comment-face)) | 194 font-lock-comment-face)) |
195 | 195 |
196 ;; The LISP-SYNTAX argument is used by code in inf-lisp.el and is | 196 (defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive) |
197 ;; (uselessly) passed from pp.el, chistory.el, gnus-kill.el and score-mode.el | 197 "Common initialization routine for lisp modes. |
198 (defun lisp-mode-variables (&optional lisp-syntax) | 198 The LISP-SYNTAX argument is used by code in inf-lisp.el and is |
199 (uselessly) passed from pp.el, chistory.el, gnus-kill.el and score-mode.el | |
200 KEYWORDS-CASE-SENSITIVE means that for font-lock keywords will not be case sensitive." | |
199 (when lisp-syntax | 201 (when lisp-syntax |
200 (set-syntax-table lisp-mode-syntax-table)) | 202 (set-syntax-table lisp-mode-syntax-table)) |
201 (setq local-abbrev-table lisp-mode-abbrev-table) | 203 (setq local-abbrev-table lisp-mode-abbrev-table) |
202 (make-local-variable 'paragraph-ignore-fill-prefix) | 204 (make-local-variable 'paragraph-ignore-fill-prefix) |
203 (setq paragraph-ignore-fill-prefix t) | 205 (setq paragraph-ignore-fill-prefix t) |
239 (setq imenu-generic-expression lisp-imenu-generic-expression) | 241 (setq imenu-generic-expression lisp-imenu-generic-expression) |
240 (make-local-variable 'multibyte-syntax-as-symbol) | 242 (make-local-variable 'multibyte-syntax-as-symbol) |
241 (setq multibyte-syntax-as-symbol t) | 243 (setq multibyte-syntax-as-symbol t) |
242 (set (make-local-variable 'syntax-begin-function) 'beginning-of-defun) | 244 (set (make-local-variable 'syntax-begin-function) 'beginning-of-defun) |
243 (setq font-lock-defaults | 245 (setq font-lock-defaults |
244 '((lisp-font-lock-keywords | 246 `((lisp-font-lock-keywords |
245 lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) | 247 lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) |
246 nil nil (("+-*/.<>=!?$%_&~^:@" . "w")) nil | 248 nil ,keywords-case-insensitive (("+-*/.<>=!?$%_&~^:@" . "w")) nil |
247 (font-lock-mark-block-function . mark-defun) | 249 (font-lock-mark-block-function . mark-defun) |
248 (font-lock-syntactic-face-function | 250 (font-lock-syntactic-face-function |
249 . lisp-font-lock-syntactic-face-function)))) | 251 . lisp-font-lock-syntactic-face-function)))) |
250 | 252 |
251 (defun lisp-outline-level () | 253 (defun lisp-outline-level () |
462 (interactive) | 464 (interactive) |
463 (kill-all-local-variables) | 465 (kill-all-local-variables) |
464 (use-local-map lisp-mode-map) | 466 (use-local-map lisp-mode-map) |
465 (setq major-mode 'lisp-mode) | 467 (setq major-mode 'lisp-mode) |
466 (setq mode-name "Lisp") | 468 (setq mode-name "Lisp") |
467 (lisp-mode-variables) | 469 (lisp-mode-variables nil t) |
468 (make-local-variable 'comment-start-skip) | 470 (make-local-variable 'comment-start-skip) |
469 (setq comment-start-skip | 471 (setq comment-start-skip |
470 "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") | 472 "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") |
471 (setq imenu-case-fold-search t) | 473 (setq imenu-case-fold-search t) |
472 (set-syntax-table lisp-mode-syntax-table) | 474 (set-syntax-table lisp-mode-syntax-table) |