aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1997-08-04 06:10:46 +0000
committerRichard M. Stallman <[email protected]>1997-08-04 06:10:46 +0000
commit212a75c49a3f0adb6ab944772ea42cc31b5fa934 (patch)
treecd1410a77a71934658d75ad60e025afaf863d150 /lisp/progmodes
parent18195655171cb15b350439de2404e2070aaa8574 (diff)
(cpp-create-bg-face): Don't really make a face.
Just make (background-color . COLOR). (cpp-highlight-buffer): Don't die if buffer-invisibility-spec is t. (cpp-face-default-list): Doc fix, fix custom type.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cpp.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el
index 8510a15088..618e5f2457 100644
--- a/lisp/progmodes/cpp.el
+++ b/lisp/progmodes/cpp.el
@@ -131,8 +131,12 @@ Each entry is a list with the following elements:
("both" . both)))
(defcustom cpp-face-default-list nil
- "List of faces you can choose from for cpp conditionals."
- :type '(repeat face)
+ "Alist of faces you can choose from for cpp conditionals.
+Each element has the form (STRING . FACE), where STRING
+serves as a name (for `cpp-highlight-buffer' only)
+and FACE is either a face (a symbol)
+or a cons cell (background-color . COLOR)."
+ :type '(repeat (cons string (choice face (cons (const background-color) string))))
:group 'cpp)
(defcustom cpp-face-light-name-list
@@ -204,7 +208,8 @@ This command pops up a buffer which you should edit to specify
what kind of highlighting to use, and the criteria for highlighting.
A prefix arg suppresses display of that buffer."
(interactive "P")
- (unless (memq 'cpp buffer-invisibility-spec)
+ (unless (or (eq t buffer-invisibility-spec)
+ (memq 'cpp buffer-invisibility-spec))
(add-to-invisibility-spec 'cpp))
(setq cpp-parse-symbols nil)
(cpp-parse-reset)
@@ -788,10 +793,7 @@ BRANCH should be either nil (false branch), t (true branch) or 'both."
(defun cpp-create-bg-face (color)
;; Create entry for face with background COLOR.
- (let ((name (intern (concat "cpp " color))))
- (make-face name)
- (set-face-background name color)
- (cons color name)))
+ (cons color (cons 'background-color color)))
(cpp-choose-default-face (if window-system cpp-face-type 'none))