annotate lisp/energize/energize-font-lock.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 0293115a14e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;; interactive turn on and off of the font-lock-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; along with XEmacs; see the file COPYING. If not, write to the Free
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; This file is preloaded, but font-lock.el is not.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; Make the font-lock faces exist at startup time, so that people can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; mess with them in their .emacs file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; They will be initialized either: from the resource db when the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; frame is created; or by font-lock.el when it is first loaded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (make-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (make-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (make-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (make-face 'font-lock-function-name-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (make-face 'font-lock-keyword-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (make-face 'font-lock-type-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; Fontify Energize Error Log
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defconst energize-log-font-lock-keywords
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (purecopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 '(("^ *Note:.*$" . font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ("^ *Warning:.*$" . font-lock-keyword-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ("^ *Error:.*$" . font-lock-function-name-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ("^/.* file system is full\r?$" . font-lock-function-name-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 "Expressions to highlight in the Energize Error Log.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (add-hook 'energize-log-mode-hook 'turn-on-font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; font-lock is a kludge. Why does it have to be such a pain to configure?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defun energize-configure-font-lock-mode (on-p font-p less-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (setq font-p (or font-p (not (x-color-display-p))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (cond (on-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (add-hook 'c++-mode-hook 'turn-on-font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (add-hook 'c-mode-hook 'turn-on-font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (add-hook 'lisp-mode-hook 'turn-on-font-lock))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (remove-hook 'c++-mode-hook 'turn-on-font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (remove-hook 'c-mode-hook 'turn-on-font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (remove-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (remove-hook 'lisp-mode-hook 'turn-on-font-lock)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (cond (font-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (remove-hook 'font-lock-mode-hook 'font-lock-use-default-colors)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (add-hook 'font-lock-mode-hook 'font-lock-use-default-fonts))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (remove-hook 'font-lock-mode-hook 'font-lock-use-default-fonts)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (add-hook 'font-lock-mode-hook 'font-lock-use-default-colors)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (cond (less-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (remove-hook 'font-lock-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 'font-lock-use-default-maximal-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (add-hook 'font-lock-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 'font-lock-use-default-minimal-decoration))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (remove-hook 'font-lock-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 'font-lock-use-default-minimal-decoration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (add-hook 'font-lock-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 'font-lock-use-default-maximal-decoration))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76