]> code.delx.au - gnu-emacs/commitdiff
Improve the custom type of some user options.
authorGlenn Morris <rgm@gnu.org>
Sat, 30 Jan 2016 19:48:18 +0000 (11:48 -0800)
committerGlenn Morris <rgm@gnu.org>
Sat, 30 Jan 2016 19:51:10 +0000 (11:51 -0800)
* lisp/desktop.el (desktop-minor-mode-table):
* lisp/man.el (Man-frame-parameters):
* lisp/midnight.el (midnight-delay):
* lisp/speedbar.el (speedbar-select-frame-method):
* lisp/tooltip.el (tooltip-frame-parameters):
* lisp/tree-widget.el (tree-widget-space-width):
* lisp/type-break.el (type-break-keystroke-threshold):
* lisp/woman.el (woman-imenu-generic-expression):
* lisp/cedet/ede.el (ede-debug-program-function):
* lisp/cedet/ede/project-am.el (project-am-debug-target-function):
* lisp/emulation/viper-keym.el (viper-toggle-key):
* lisp/erc/erc-networks.el (erc-server-alist):
* lisp/gnus/message.el (message-deletable-headers, message-signature):
* lisp/mail/mailalias.el (mail-directory-stream):
* lisp/play/tetris.el (tetris-x-colors):
* lisp/progmodes/gud.el (gud-tooltip-modes): Improve custom type.

16 files changed:
lisp/cedet/ede.el
lisp/cedet/ede/project-am.el
lisp/desktop.el
lisp/emulation/viper-keym.el
lisp/erc/erc-networks.el
lisp/gnus/message.el
lisp/mail/mailalias.el
lisp/man.el
lisp/midnight.el
lisp/play/tetris.el
lisp/progmodes/gud.el
lisp/speedbar.el
lisp/tooltip.el
lisp/tree-widget.el
lisp/type-break.el
lisp/woman.el

index 41d6c8903b0f10f52ea325b2cebf61cea173d97e..f013d4302b71e98969d520f00ab1e6d93a2c126a 100644 (file)
@@ -96,7 +96,7 @@ target willing to take the file.  `never' means never perform the check."
 (defcustom ede-debug-program-function 'gdb
   "Default Emacs command used to debug a target."
   :group 'ede
-  :type 'sexp) ; make this be a list of options some day
+  :type 'function) ; make this be a list of options some day
 
 (defcustom ede-project-directories nil
   "Directories in which EDE may search for project files.
index e1b0c3d74feadbf7bb454e328582a33617b98440..715f3cf46d514c5ccebfc0a7e27e89f40e90aa3b 100644 (file)
@@ -65,7 +65,7 @@
 (defcustom project-am-debug-target-function 'gdb
   "*Default Emacs command used to debug a target."
   :group 'project-am
-  :type 'sexp) ; make this be a list some day
+  :type 'function) ; make this be a list some day
 
 (defconst project-am-type-alist
   '(("bin" project-am-program "bin_PROGRAMS" t)
index e795d9c23007062300e06b526d23db066625253b..822db050e1fed2d2593d3e1b668f3126c19ca714 100644 (file)
@@ -554,7 +554,9 @@ RESTORE-FUNCTION nil means don't try to restore the minor mode.
 Only minor modes for which the name of the buffer-local variable
 and the name of the minor mode function are different have to be added to
 this table.  See also `desktop-minor-mode-handlers'."
-  :type 'sexp
+  :type '(alist :key-type (symbol :tag "Minor mode")
+                :value-type (list :tag "Restore function"
+                                  (choice (const nil) function)))
   :group 'desktop)
 
 ;;;###autoload
index 998f850f8c50ed416ca54161f66451352a34b312..f5bb32fcb2da62b0bcc97e5598799f77ba3549d2 100644 (file)
@@ -154,10 +154,8 @@ viper-insert-basic-map.  Not recommended, except for novice users.")
 ;; Some important keys used in viper
 (defcustom viper-toggle-key [(control ?z)]  ; "\C-z"
   "The key used to change states from Emacs to Vi and back.
-In insert mode, this key also functions as Meta.
-
-Enter as a sexp.  Examples: \"\\C-z\", [(control ?z)]."
-  :type 'sexp
+In insert mode, this key also functions as Meta."
+  :type 'key-sequence
   :group 'viper
   :set (lambda (symbol value)
         (let ((old-value (if (boundp 'viper-toggle-key)
index c859a48a79a69f8411b6af65a1b67c2f35e776ec..f911d6438be0bcf315cfe91ce84f4c00f1a8f940 100644 (file)
@@ -443,7 +443,15 @@ NET is a symbol indicating to which network from `erc-networks-alist' this
 HOST is the servers hostname and
 PORTS is either a number, a list of numbers, or a list of port ranges."
   :group 'erc-networks
-  :type 'sexp)
+  :type '(alist :key-type (string :tag "Name")
+               :value-type
+               (group symbol (string :tag "Hostname")
+                      (choice :tag "Ports"
+                              (integer :tag "Port number")
+                              (repeat :tag "List of ports or ranges"
+                                      (choice (integer :tag "Port number")
+                                              (list :tag "Port range"
+                                                    integer integer)))))))
 
 (defcustom erc-networks-alist
   '((4-irc "4-irc.com")
index f175036e96f8c8a7709e92c338a20c91b38a8524..27cae74c755958f63ac2ec5e2ca045500cffb3c9 100644 (file)
@@ -256,10 +256,10 @@ This is a list of regexps and regexp matches."
   :type '(repeat regexp))
 
 (defcustom message-deletable-headers '(Message-ID Date Lines)
-  "Headers to be deleted if they already exist and were generated by message previously."
+  "Headers to delete if present and previously generated by message."
   :group 'message-headers
   :link '(custom-manual "(message)Message Headers")
-  :type 'sexp)
+  :type '(repeat (symbol :tag "Header")))
 
 (defcustom message-ignored-news-headers
   "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:\\|^X-Message-SMTP-Method:\\|^X-Gnus-Delayed:"
@@ -1072,7 +1072,9 @@ If t, the `message-signature-file' file will be inserted instead.
 If a function, the result from the function will be used instead.
 If a form, the result from the form will be used instead."
   :version "23.2"
-  :type 'sexp
+  :type '(choice string (const :tag "Contents of signature file" t)
+                function
+                sexp)
   :risky t
   :link '(custom-manual "(message)Insertion Variables")
   :group 'message-insertion)
index 35528af2c4994112dda4bedc5d172e6a579ec01c..59670a7dcbdffcbc27a747e1a0e773e8d93dd1e9 100644 (file)
@@ -130,7 +130,12 @@ or like this:
 
 (defcustom mail-directory-stream nil
   "List of (HOST SERVICE) for stream connection to mail directory."
-  :type 'sexp
+  :type '(choice (const nil)
+                 (list (string :tag "Host name or ip address")
+                       (choice (integer :tag "Service port number")
+                               (string :tag "Service name"))
+                       (plist :inline t
+                              :tag "Additional open-network-stream parameters")))
   :group 'mailalias)
 (put 'mail-directory-stream 'risky-local-variable t)
 
index 04a7fc3fe7ae4ca773d436d8795e96f6e180cfcb..b483dd12e8a3ca0bec18345591750454d84f70ad 100644 (file)
@@ -184,7 +184,9 @@ The value also can be a positive integer for a fixed width."
 
 (defcustom Man-frame-parameters nil
   "Frame parameter list for creating a new frame for a manual page."
-  :type 'sexp
+  :type '(repeat (cons :format "%v"
+                      (symbol :tag "Parameter")
+                      (sexp :tag "Value")))
   :group 'man)
 
 (defcustom Man-downcase-section-letters-flag t
index a9eedd74624d08f9bb5460d88322de8126fe7282..0e68eb923cd382a860f1c494150731df9ef21dee 100644 (file)
@@ -217,7 +217,7 @@ You should set this variable before loading midnight.el, or
 set it by calling `midnight-delay-set', or use `custom'.
 If you wish, you can use a string instead, it will be passed as the
 first argument to `run-at-time'."
-  :type 'sexp
+  :type '(choice integer string)
   :set #'midnight-delay-set)
 
 (provide 'midnight)
index b68b54174794b3f11ab3cd08dba19a28b043b238..d4ab668a4e95dfbf2db920c278aa83682b7653b2 100644 (file)
@@ -87,9 +87,15 @@ If the return value is a number, it is used as the timer period."
 
 (defcustom tetris-x-colors
   [[0 0 1] [0.7 0 1] [1 1 0] [1 0 1] [0 1 1] [0 1 0] [1 0 0]]
-  "Vector of colors of the various shapes."
+  "Vector of RGB colors of the various shapes."
   :group 'tetris
-  :type 'sexp)
+  :type '(vector (vector :tag "Shape 1" number number number)
+                 (vector :tag "Shape 2" number number number)
+                 (vector :tag "Shape 3" number number number)
+                 (vector :tag "Shape 4" number number number)
+                 (vector :tag "Shape 5" number number number)
+                 (vector :tag "Shape 6" number number number)
+                 (vector :tag "Shape 7" number number number)))
 
 (defcustom tetris-buffer-name "*Tetris*"
   "Name used for Tetris buffer."
index 7843efdf158b903e2b75a31c3a040199447ff23d..356cd3e05329a90f0b72836f21d2b944606ce787 100644 (file)
@@ -3406,7 +3406,7 @@ it if ARG is omitted or nil."
 (defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode
                                        python-mode)
   "List of modes for which to enable GUD tooltips."
-  :type 'sexp
+  :type '(repeat (symbol :tag "Major mode"))
   :group 'gud
   :group 'tooltip)
 
index f46987320776b827c77dde3c4d02d39b08323bda..4ed00ae439d0887981895aa7332d33c82741b2f9 100644 (file)
@@ -3469,11 +3469,11 @@ TOKEN will be the list, and INDENT is the current indentation level."
 ;;
 (defcustom speedbar-select-frame-method 'attached
   "Specify how to select a frame for displaying a file.
-A value of `attached' means to use the attached frame (the frame
-that speedbar was started from.)  A number such as 1 or -1 means to
-pass that number to `other-frame' while selecting a frame from speedbar."
+A number such as 1 or -1 means to pass that number to `other-frame'
+while selecting a frame from speedbar.  Any other value means to use
+the attached frame (the frame that speedbar was started from)."
   :group 'speedbar
-  :type 'sexp)
+  :type '(choice integer (other :tag "attached" attached)))
 
 (defun speedbar-find-file-in-frame (file)
   "This will load FILE into the speedbar attached frame.
index ce190e958293c893eb729bf87bf6765963b58147..60eabec8b43ff8795ff074c8383211d9366d1a86 100644 (file)
@@ -127,7 +127,9 @@ position to pop up the tooltip.
 
 Note that font and color parameters are ignored, and the attributes
 of the `tooltip' face are used instead."
-  :type 'sexp
+  :type '(repeat (cons :format "%v"
+                      (symbol :tag "Parameter")
+                      (sexp :tag "Value")))
   :group 'tooltip)
 
 (defface tooltip
index fd502dd1847277f3d6aca7f263377af7ea66a283..0ffb8dc96dc1d97dbf3282830bb4655c09ffbbe4 100644 (file)
@@ -208,9 +208,11 @@ icon widgets used to draw the tree.  By default these images are used:
 
 (defcustom tree-widget-space-width 0.5
   "Amount of space between an icon image and a node widget.
-Must be a valid space :width display property."
+Must be a valid space :width display property.
+See Info node `(elisp)Specified Space'."
   :group 'tree-widget
-  :type 'sexp)
+  :type '(choice (number :tag "Multiple of normal character width")
+                 sexp))
 \f
 ;;; Image support
 ;;
index ba708b2956cc35ff09549e9862b53f061437112b..0b3ee756619379a74ba2e9a72aabfc8d4af87149 100644 (file)
@@ -133,7 +133,7 @@ keystroke even though they really require multiple keys to generate them.
 The command `type-break-guesstimate-keystroke-threshold' can be used to
 guess a reasonably good pair of values for this variable."
   :set-after '(type-break-interval)
-  :type 'sexp
+  :type '(cons (choice integer (const nil)) (choice integer (const nil)))
   :group 'type-break)
 
 (defcustom type-break-query-function 'yes-or-no-p
index 4ca7dbee5de3a37ad4245567cc7d531bc1a0669c..28a47986c2f5ac25350c1cfbdd607a7920934423 100644 (file)
@@ -752,7 +752,10 @@ Default is t."
   "Imenu support for Sections and Subsections.
 An alist with elements of the form (MENU-TITLE REGEXP INDEX) --
 see the documentation for `imenu-generic-expression'."
-  :type 'sexp
+  :type '(alist :key-type (choice :tag "Title" (const nil) string)
+                :value-type (group (choice (string :tag "Regexp")
+                                           function)
+                                   integer))
   :group 'woman-interface)
 
 (defcustom woman-imenu nil