changeset 19009:1493fc19f324

Customized.
author Richard M. Stallman <rms@gnu.org>
date Sun, 27 Jul 1997 19:53:27 +0000
parents 12eb62604fa7
children baf7d9450075
files lisp/facemenu.el lisp/progmodes/cpp.el
diffstat 2 files changed, 106 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/facemenu.el	Sun Jul 27 19:50:06 1997 +0000
+++ b/lisp/facemenu.el	Sun Jul 27 19:53:27 1997 +0000
@@ -102,7 +102,12 @@
 (define-key global-map [C-down-mouse-2] 'facemenu-menu)
 (define-key global-map "\M-g" 'facemenu-keymap)
 
-(defvar facemenu-keybindings
+(defgroup facemenu nil
+  "Create a face menu for interactively adding fonts to text"
+  :group 'faces
+  :prefix "facemenu-")
+
+(defcustom facemenu-keybindings
   '((default     . "d")
     (bold        . "b")
     (italic      . "i")
@@ -119,14 +124,18 @@
 but get no keyboard equivalents.
 
 If you change this variable after loading facemenu.el, you will need to call
-`facemenu-update' to make it take effect.")
+`facemenu-update' to make it take effect."
+  :type '(repeat (cons face string))
+  :group 'facemenu)
 
-(defvar facemenu-new-faces-at-end t
+(defcustom facemenu-new-faces-at-end t
   "*Where in the menu to insert newly-created faces.
 This should be nil to put them at the top of the menu, or t to put them
-just before \"Other\" at the end.")
+just before \"Other\" at the end."
+  :type 'boolean
+  :group 'facemenu)
 
-(defvar facemenu-unlisted-faces
+(defcustom facemenu-unlisted-faces
   '(modeline region secondary-selection highlight scratch-face)
   "*List of faces not to include in the Face menu.
 You can set this list before loading facemenu.el, or add a face to it before
@@ -136,7 +145,11 @@
 
 If this variable is t, no faces will be added to the menu.  This is useful for
 temporarily turning off the feature that automatically adds faces to the menu
-when they are created.")
+when they are created."
+  :type '(choice (const :tag "Don't add" t)
+		 (const :tag "None" nil)
+		 (repeat face))
+  :group 'facemenu)
 
 ;;;###autoload
 (defvar facemenu-face-menu
@@ -242,20 +255,31 @@
 (defalias 'facemenu-keymap facemenu-keymap)
 
 
-(defvar facemenu-add-face-function nil
+(defcustom facemenu-add-face-function nil
   "Function called at beginning of text to change or `nil'.
 This function is passed the FACE to set and END of text to change, and must
-return a string which is inserted.  It may set `facemenu-end-add-face'.")
+return a string which is inserted.  It may set `facemenu-end-add-face'."
+  :type '(choice (const :tag "None" nil)
+		 function)
+  :group 'facemenu)
 
-(defvar facemenu-end-add-face nil
+(defcustom facemenu-end-add-face nil
   "String to insert or function called at end of text to change or `nil'.
 This function is passed the FACE to set, and must return a string which is
-inserted.")
+inserted."
+  :type '(choice (const :tag "None" nil)
+		 string
+		 function)
+  :group 'facemenu)
 
-(defvar facemenu-remove-face-function nil
+(defcustom facemenu-remove-face-function nil
   "When non-nil, this is a function called to remove faces.
 This function is passed the START and END of text to change.
-May also be `t' meaning to use `facemenu-add-face-function'.")
+May also be `t' meaning to use `facemenu-add-face-function'."
+  :type '(choice (const :tag "None" nil)
+		 (const :tag "Use add-face" t)
+		 function)
+  :group 'facemenu)
 
 ;;; Internal Variables
 
--- a/lisp/progmodes/cpp.el	Sun Jul 27 19:50:06 1997 +0000
+++ b/lisp/progmodes/cpp.el	Sun Jul 27 19:53:27 1997 +0000
@@ -47,34 +47,56 @@
 ;;; Code:
 
 ;;; Customization:
+(defgroup cpp nil
+  "Highlight or hide text according to cpp conditionals."
+  :group 'C
+  :prefix "cpp-")
 
-(defvar cpp-config-file (convert-standard-filename ".cpp.el")
-  "*File name to save cpp configuration.")
+(defcustom cpp-config-file (convert-standard-filename ".cpp.el")
+  "*File name to save cpp configuration."
+  :type 'file
+  :group 'cpp)
 
-(defvar cpp-known-face 'invisible
-  "*Face used for known cpp symbols.")
+(defcustom cpp-known-face 'invisible
+  "*Face used for known cpp symbols."
+  :type 'face
+  :group 'cpp)
 
-(defvar cpp-unknown-face 'highlight
-  "*Face used for unknown cpp symbols.")
+(defcustom cpp-unknown-face 'highlight
+  "*Face used for unknown cpp symbols."
+  :type 'face
+  :group 'cpp)
 
-(defvar cpp-face-type 'light 
+(defcustom cpp-face-type 'light 
   "*Indicate what background face type you prefer.
 Can be either light or dark for color screens, mono for monochrome
-screens, and none if you don't use a window system.")
-
-(defvar cpp-known-writable t
-  "*Non-nil means you are allowed to modify the known conditionals.")
+screens, and none if you don't use a window system."
+  :options '(light dark mono nil)
+  :type 'symbol
+  :group 'cpp)
 
-(defvar cpp-unknown-writable t
-  "*Non-nil means you are allowed to modify the unknown conditionals.")
+(defcustom cpp-known-writable t
+  "*Non-nil means you are allowed to modify the known conditionals."
+  :type 'boolean
+  :group 'cpp)
 
-(defvar cpp-edit-list nil
+(defcustom cpp-unknown-writable t
+  "*Non-nil means you are allowed to modify the unknown conditionals."
+  :type 'boolean
+  :group 'cpp)
+
+(defcustom cpp-edit-list nil
   "Alist of cpp macros and information about how they should be displayed.
 Each entry is a list with the following elements:
 0. The name of the macro (a string).
 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.")
+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))))
+  :group 'cpp)
 
 (defvar cpp-overlay-list nil)
 ;; List of cpp overlays active in the current buffer.
@@ -108,38 +130,52 @@
     ("true" . t)
     ("both" . both)))
 
-(defvar cpp-face-default-list nil
-  "List of faces you can choose from for cpp conditionals.")
+(defcustom cpp-face-default-list nil
+  "List of faces you can choose from for cpp conditionals."
+  :type '(repeat face)
+  :group 'cpp)
 
-(defvar cpp-face-light-name-list
+(defcustom cpp-face-light-name-list
   '("light gray" "light blue" "light cyan" "light yellow" "light pink"
     "pale green" "beige" "orange" "magenta" "violet" "medium purple"
     "turquoise")
-  "Background colours useful with dark foreground colors.")
+  "Background colours useful with dark foreground colors."
+  :type '(repeat string)
+  :group 'cpp)
 
-(defvar cpp-face-dark-name-list
+(defcustom cpp-face-dark-name-list
   '("dim gray" "blue" "cyan" "yellow" "red"
     "dark green" "brown" "dark orange" "dark khaki" "dark violet" "purple"
     "dark turquoise")
-  "Background colours useful with light foreground colors.")
+  "Background colours useful with light foreground colors."
+  :type '(repeat string)
+  :group 'cpp)
 
-(defvar cpp-face-light-list nil
-  "Alist of names and faces to be used for light backgrounds.")
-
-(defvar cpp-face-dark-list nil
-  "Alist of names and faces to be used for dark backgrounds.")
+(defcustom cpp-face-light-list nil
+  "Alist of names and faces to be used for light backgrounds."
+  :type '(repeat (cons string face))
+  :group 'cpp)
 
-(defvar cpp-face-mono-list
-  '(("bold" . 'bold)
-    ("bold-italic" . 'bold-italic)
-    ("italic" . 'italic)
-    ("underline" . 'underline))
-  "Alist of names and faces to be used for monochrome screens.")
+(defcustom cpp-face-dark-list nil
+  "Alist of names and faces to be used for dark backgrounds."
+  :type '(repeat (cons string face))
+  :group 'cpp)
 
-(defvar cpp-face-none-list
+(defcustom cpp-face-mono-list
+  '(("bold" . bold)
+    ("bold-italic" . bold-italic)
+    ("italic" . italic)
+    ("underline" . underline))
+  "Alist of names and faces to be used for monochrome screens."
+  :type '(repeat (cons string face))
+  :group 'cpp)
+
+(defcustom cpp-face-none-list
    '(("default" . default)
      ("invisible" . invisible))
-   "Alist of names and faces available even if you don't use a window system.")
+   "Alist of names and faces available even if you don't use a window system."
+  :type '(repeat (cons string face))
+  :group 'cpp)
 
 (defvar cpp-face-all-list
   (append cpp-face-light-list