comparison lisp/progmodes/cpp.el @ 67563:fdc28fc82a27

(cpp-face): New widget. (cpp-known-face, cpp-unknown-face, cpp-edit-list): Use it.
author Juri Linkov <juri@jurta.org>
date Wed, 14 Dec 2005 07:47:01 +0000
parents a11fdee52c05
children 4009e1aa393f
comparison
equal deleted inserted replaced
67562:890887cd17a8 67563:fdc28fc82a27
57 (defcustom cpp-config-file (convert-standard-filename ".cpp.el") 57 (defcustom cpp-config-file (convert-standard-filename ".cpp.el")
58 "*File name to save cpp configuration." 58 "*File name to save cpp configuration."
59 :type 'file 59 :type 'file
60 :group 'cpp) 60 :group 'cpp)
61 61
62 (define-widget 'cpp-face 'lazy
63 "Either a face or the special symbol 'invisible'."
64 :type '(choice (const invisible) (face)))
65
62 (defcustom cpp-known-face 'invisible 66 (defcustom cpp-known-face 'invisible
63 "*Face used for known cpp symbols." 67 "*Face used for known cpp symbols."
64 :type 'face 68 :type 'cpp-face
65 :group 'cpp) 69 :group 'cpp)
66 70
67 (defcustom cpp-unknown-face 'highlight 71 (defcustom cpp-unknown-face 'highlight
68 "*Face used for unknown cpp symbols." 72 "*Face used for unknown cpp symbols."
69 :type 'face 73 :type 'cpp-face
70 :group 'cpp) 74 :group 'cpp)
71 75
72 (defcustom cpp-face-type 'light 76 (defcustom cpp-face-type 'light
73 "*Indicate what background face type you prefer. 77 "*Indicate what background face type you prefer.
74 Can be either light or dark for color screens, mono for monochrome 78 Can be either light or dark for color screens, mono for monochrome
93 Each entry is a list with the following elements: 97 Each entry is a list with the following elements:
94 0. The name of the macro (a string). 98 0. The name of the macro (a string).
95 1. Face used for text that is `ifdef' the macro. 99 1. Face used for text that is `ifdef' the macro.
96 2. Face used for text that is `ifndef' the macro. 100 2. Face used for text that is `ifndef' the macro.
97 3. t, nil, or `both' depending on what text may be edited." 101 3. t, nil, or `both' depending on what text may be edited."
98 :type '(repeat (list string face face 102 :type '(repeat (list (string :tag "Macro")
99 (choice (const t) 103 (cpp-face :tag "True")
100 (const nil) 104 (cpp-face :tag "False")
101 (const both)))) 105 (choice (const :tag "True branch writable" t)
106 (const :tag "False branch writeable" nil)
107 (const :tag "Both branches writeable" both))))
102 :group 'cpp) 108 :group 'cpp)
103 109
104 (defvar cpp-overlay-list nil) 110 (defvar cpp-overlay-list nil)
105 ;; List of cpp overlays active in the current buffer. 111 ;; List of cpp overlays active in the current buffer.
106 (make-variable-buffer-local 'cpp-overlay-list) 112 (make-variable-buffer-local 'cpp-overlay-list)