From cf717a0d2414ddaa16842429c88dc744dd68e98e Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 14 Dec 2005 07:48:11 +0000 Subject: [PATCH] (cpp-face): New widget. (cpp-known-face, cpp-unknown-face, cpp-edit-list): Use it. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/cpp.el | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 999f8807902..f1aecc27426 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-12-14 Per Abrahamsen + + * progmodes/cpp.el (cpp-face): New widget. + (cpp-known-face, cpp-unknown-face, cpp-edit-list): Use it. + 2005-12-14 Juri Linkov * help-macro.el (make-help-screen): Bind `inhibit-read-only' to t diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index 11d0ba444f3..7e0bb8b4f9b 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el @@ -59,14 +59,18 @@ :type 'file :group 'cpp) +(define-widget 'cpp-face 'lazy + "Either a face or the special symbol 'invisible'." + :type '(choice (const invisible) (face))) + (defcustom cpp-known-face 'invisible "*Face used for known cpp symbols." - :type 'face + :type 'cpp-face :group 'cpp) (defcustom cpp-unknown-face 'highlight "*Face used for unknown cpp symbols." - :type 'face + :type 'cpp-face :group 'cpp) (defcustom cpp-face-type 'light @@ -95,10 +99,12 @@ Each entry is a list with the following elements: 1. Face used for text that is `ifdef' the macro. 2. Face used for text that is `ifndef' the macro. 3. t, nil, or `both' depending on what text may be edited." - :type '(repeat (list string face face - (choice (const t) - (const nil) - (const both)))) + :type '(repeat (list (string :tag "Macro") + (cpp-face :tag "True") + (cpp-face :tag "False") + (choice (const :tag "True branch writable" t) + (const :tag "False branch writeable" nil) + (const :tag "Both branches writeable" both)))) :group 'cpp) (defvar cpp-overlay-list nil) -- 2.39.5