comparison lisp/progmodes/cpp.el @ 19009:1493fc19f324

Customized.
author Richard M. Stallman <rms@gnu.org>
date Sun, 27 Jul 1997 19:53:27 +0000
parents bcdf720abb1a
children 35d85b50c3cb
comparison
equal deleted inserted replaced
19008:12eb62604fa7 19009:1493fc19f324
45 ;; Restore window configurations when exiting CPP Edit buffer. 45 ;; Restore window configurations when exiting CPP Edit buffer.
46 46
47 ;;; Code: 47 ;;; Code:
48 48
49 ;;; Customization: 49 ;;; Customization:
50 50 (defgroup cpp nil
51 (defvar cpp-config-file (convert-standard-filename ".cpp.el") 51 "Highlight or hide text according to cpp conditionals."
52 "*File name to save cpp configuration.") 52 :group 'C
53 53 :prefix "cpp-")
54 (defvar cpp-known-face 'invisible 54
55 "*Face used for known cpp symbols.") 55 (defcustom cpp-config-file (convert-standard-filename ".cpp.el")
56 56 "*File name to save cpp configuration."
57 (defvar cpp-unknown-face 'highlight 57 :type 'file
58 "*Face used for unknown cpp symbols.") 58 :group 'cpp)
59 59
60 (defvar cpp-face-type 'light 60 (defcustom cpp-known-face 'invisible
61 "*Face used for known cpp symbols."
62 :type 'face
63 :group 'cpp)
64
65 (defcustom cpp-unknown-face 'highlight
66 "*Face used for unknown cpp symbols."
67 :type 'face
68 :group 'cpp)
69
70 (defcustom cpp-face-type 'light
61 "*Indicate what background face type you prefer. 71 "*Indicate what background face type you prefer.
62 Can be either light or dark for color screens, mono for monochrome 72 Can be either light or dark for color screens, mono for monochrome
63 screens, and none if you don't use a window system.") 73 screens, and none if you don't use a window system."
64 74 :options '(light dark mono nil)
65 (defvar cpp-known-writable t 75 :type 'symbol
66 "*Non-nil means you are allowed to modify the known conditionals.") 76 :group 'cpp)
67 77
68 (defvar cpp-unknown-writable t 78 (defcustom cpp-known-writable t
69 "*Non-nil means you are allowed to modify the unknown conditionals.") 79 "*Non-nil means you are allowed to modify the known conditionals."
70 80 :type 'boolean
71 (defvar cpp-edit-list nil 81 :group 'cpp)
82
83 (defcustom cpp-unknown-writable t
84 "*Non-nil means you are allowed to modify the unknown conditionals."
85 :type 'boolean
86 :group 'cpp)
87
88 (defcustom cpp-edit-list nil
72 "Alist of cpp macros and information about how they should be displayed. 89 "Alist of cpp macros and information about how they should be displayed.
73 Each entry is a list with the following elements: 90 Each entry is a list with the following elements:
74 0. The name of the macro (a string). 91 0. The name of the macro (a string).
75 1. Face used for text that is `ifdef' the macro. 92 1. Face used for text that is `ifdef' the macro.
76 2. Face used for text that is `ifndef' the macro. 93 2. Face used for text that is `ifndef' the macro.
77 3. `t', `nil', or `both' depending on what text may be edited.") 94 3. `t', `nil', or `both' depending on what text may be edited."
95 :type '(repeat (list string face face
96 (choice (const t)
97 (const nil)
98 (const both))))
99 :group 'cpp)
78 100
79 (defvar cpp-overlay-list nil) 101 (defvar cpp-overlay-list nil)
80 ;; List of cpp overlays active in the current buffer. 102 ;; List of cpp overlays active in the current buffer.
81 (make-variable-buffer-local 'cpp-overlay-list) 103 (make-variable-buffer-local 'cpp-overlay-list)
82 104
106 ;; Alist of branches. 128 ;; Alist of branches.
107 '(("false" . nil) 129 '(("false" . nil)
108 ("true" . t) 130 ("true" . t)
109 ("both" . both))) 131 ("both" . both)))
110 132
111 (defvar cpp-face-default-list nil 133 (defcustom cpp-face-default-list nil
112 "List of faces you can choose from for cpp conditionals.") 134 "List of faces you can choose from for cpp conditionals."
113 135 :type '(repeat face)
114 (defvar cpp-face-light-name-list 136 :group 'cpp)
137
138 (defcustom cpp-face-light-name-list
115 '("light gray" "light blue" "light cyan" "light yellow" "light pink" 139 '("light gray" "light blue" "light cyan" "light yellow" "light pink"
116 "pale green" "beige" "orange" "magenta" "violet" "medium purple" 140 "pale green" "beige" "orange" "magenta" "violet" "medium purple"
117 "turquoise") 141 "turquoise")
118 "Background colours useful with dark foreground colors.") 142 "Background colours useful with dark foreground colors."
119 143 :type '(repeat string)
120 (defvar cpp-face-dark-name-list 144 :group 'cpp)
145
146 (defcustom cpp-face-dark-name-list
121 '("dim gray" "blue" "cyan" "yellow" "red" 147 '("dim gray" "blue" "cyan" "yellow" "red"
122 "dark green" "brown" "dark orange" "dark khaki" "dark violet" "purple" 148 "dark green" "brown" "dark orange" "dark khaki" "dark violet" "purple"
123 "dark turquoise") 149 "dark turquoise")
124 "Background colours useful with light foreground colors.") 150 "Background colours useful with light foreground colors."
125 151 :type '(repeat string)
126 (defvar cpp-face-light-list nil 152 :group 'cpp)
127 "Alist of names and faces to be used for light backgrounds.") 153
128 154 (defcustom cpp-face-light-list nil
129 (defvar cpp-face-dark-list nil 155 "Alist of names and faces to be used for light backgrounds."
130 "Alist of names and faces to be used for dark backgrounds.") 156 :type '(repeat (cons string face))
131 157 :group 'cpp)
132 (defvar cpp-face-mono-list 158
133 '(("bold" . 'bold) 159 (defcustom cpp-face-dark-list nil
134 ("bold-italic" . 'bold-italic) 160 "Alist of names and faces to be used for dark backgrounds."
135 ("italic" . 'italic) 161 :type '(repeat (cons string face))
136 ("underline" . 'underline)) 162 :group 'cpp)
137 "Alist of names and faces to be used for monochrome screens.") 163
138 164 (defcustom cpp-face-mono-list
139 (defvar cpp-face-none-list 165 '(("bold" . bold)
166 ("bold-italic" . bold-italic)
167 ("italic" . italic)
168 ("underline" . underline))
169 "Alist of names and faces to be used for monochrome screens."
170 :type '(repeat (cons string face))
171 :group 'cpp)
172
173 (defcustom cpp-face-none-list
140 '(("default" . default) 174 '(("default" . default)
141 ("invisible" . invisible)) 175 ("invisible" . invisible))
142 "Alist of names and faces available even if you don't use a window system.") 176 "Alist of names and faces available even if you don't use a window system."
177 :type '(repeat (cons string face))
178 :group 'cpp)
143 179
144 (defvar cpp-face-all-list 180 (defvar cpp-face-all-list
145 (append cpp-face-light-list 181 (append cpp-face-light-list
146 cpp-face-dark-list 182 cpp-face-dark-list
147 cpp-face-mono-list 183 cpp-face-mono-list