Improve the custom type of some user options.

* 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.
This commit is contained in:
Glenn Morris 2016-01-30 11:48:18 -08:00
parent 2df0e04296
commit 0fac75fed1
16 changed files with 56 additions and 26 deletions

View file

@ -96,7 +96,7 @@ target willing to take the file. `never' means never perform the check."
(defcustom ede-debug-program-function 'gdb (defcustom ede-debug-program-function 'gdb
"Default Emacs command used to debug a target." "Default Emacs command used to debug a target."
:group 'ede :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 (defcustom ede-project-directories nil
"Directories in which EDE may search for project files. "Directories in which EDE may search for project files.

View file

@ -65,7 +65,7 @@
(defcustom project-am-debug-target-function 'gdb (defcustom project-am-debug-target-function 'gdb
"*Default Emacs command used to debug a target." "*Default Emacs command used to debug a target."
:group 'project-am :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 (defconst project-am-type-alist
'(("bin" project-am-program "bin_PROGRAMS" t) '(("bin" project-am-program "bin_PROGRAMS" t)

View 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 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 and the name of the minor mode function are different have to be added to
this table. See also `desktop-minor-mode-handlers'." 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) :group 'desktop)
;;;###autoload ;;;###autoload

View file

@ -154,10 +154,8 @@ viper-insert-basic-map. Not recommended, except for novice users.")
;; Some important keys used in viper ;; Some important keys used in viper
(defcustom viper-toggle-key [(control ?z)] ; "\C-z" (defcustom viper-toggle-key [(control ?z)] ; "\C-z"
"The key used to change states from Emacs to Vi and back. "The key used to change states from Emacs to Vi and back.
In insert mode, this key also functions as Meta. In insert mode, this key also functions as Meta."
:type 'key-sequence
Enter as a sexp. Examples: \"\\C-z\", [(control ?z)]."
:type 'sexp
:group 'viper :group 'viper
:set (lambda (symbol value) :set (lambda (symbol value)
(let ((old-value (if (boundp 'viper-toggle-key) (let ((old-value (if (boundp 'viper-toggle-key)

View file

@ -443,7 +443,15 @@ NET is a symbol indicating to which network from `erc-networks-alist' this
HOST is the servers hostname and HOST is the servers hostname and
PORTS is either a number, a list of numbers, or a list of port ranges." PORTS is either a number, a list of numbers, or a list of port ranges."
:group 'erc-networks :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 (defcustom erc-networks-alist
'((4-irc "4-irc.com") '((4-irc "4-irc.com")

View file

@ -256,10 +256,10 @@ This is a list of regexps and regexp matches."
:type '(repeat regexp)) :type '(repeat regexp))
(defcustom message-deletable-headers '(Message-ID Date Lines) (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 :group 'message-headers
:link '(custom-manual "(message)Message Headers") :link '(custom-manual "(message)Message Headers")
:type 'sexp) :type '(repeat (symbol :tag "Header")))
(defcustom message-ignored-news-headers (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:" "^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 function, the result from the function will be used instead.
If a form, the result from the form will be used instead." If a form, the result from the form will be used instead."
:version "23.2" :version "23.2"
:type 'sexp :type '(choice string (const :tag "Contents of signature file" t)
function
sexp)
:risky t :risky t
:link '(custom-manual "(message)Insertion Variables") :link '(custom-manual "(message)Insertion Variables")
:group 'message-insertion) :group 'message-insertion)

View file

@ -130,7 +130,12 @@ or like this:
(defcustom mail-directory-stream nil (defcustom mail-directory-stream nil
"List of (HOST SERVICE) for stream connection to mail directory." "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) :group 'mailalias)
(put 'mail-directory-stream 'risky-local-variable t) (put 'mail-directory-stream 'risky-local-variable t)

View file

@ -184,7 +184,9 @@ The value also can be a positive integer for a fixed width."
(defcustom Man-frame-parameters nil (defcustom Man-frame-parameters nil
"Frame parameter list for creating a new frame for a manual page." "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) :group 'man)
(defcustom Man-downcase-section-letters-flag t (defcustom Man-downcase-section-letters-flag t

View 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'. 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 If you wish, you can use a string instead, it will be passed as the
first argument to `run-at-time'." first argument to `run-at-time'."
:type 'sexp :type '(choice integer string)
:set #'midnight-delay-set) :set #'midnight-delay-set)
(provide 'midnight) (provide 'midnight)

View file

@ -87,9 +87,15 @@ If the return value is a number, it is used as the timer period."
(defcustom tetris-x-colors (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]] [[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 :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*" (defcustom tetris-buffer-name "*Tetris*"
"Name used for Tetris buffer." "Name used for Tetris buffer."

View file

@ -3406,7 +3406,7 @@ it if ARG is omitted or nil."
(defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode (defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode
python-mode) python-mode)
"List of modes for which to enable GUD tooltips." "List of modes for which to enable GUD tooltips."
:type 'sexp :type '(repeat (symbol :tag "Major mode"))
:group 'gud :group 'gud
:group 'tooltip) :group 'tooltip)

View file

@ -3469,11 +3469,11 @@ TOKEN will be the list, and INDENT is the current indentation level."
;; ;;
(defcustom speedbar-select-frame-method 'attached (defcustom speedbar-select-frame-method 'attached
"Specify how to select a frame for displaying a file. "Specify how to select a frame for displaying a file.
A value of `attached' means to use the attached frame (the frame A number such as 1 or -1 means to pass that number to `other-frame'
that speedbar was started from.) A number such as 1 or -1 means to while selecting a frame from speedbar. Any other value means to use
pass that number to `other-frame' while selecting a frame from speedbar." the attached frame (the frame that speedbar was started from)."
:group 'speedbar :group 'speedbar
:type 'sexp) :type '(choice integer (other :tag "attached" attached)))
(defun speedbar-find-file-in-frame (file) (defun speedbar-find-file-in-frame (file)
"This will load FILE into the speedbar attached frame. "This will load FILE into the speedbar attached frame.

View file

@ -127,7 +127,9 @@ position to pop up the tooltip.
Note that font and color parameters are ignored, and the attributes Note that font and color parameters are ignored, and the attributes
of the `tooltip' face are used instead." of the `tooltip' face are used instead."
:type 'sexp :type '(repeat (cons :format "%v"
(symbol :tag "Parameter")
(sexp :tag "Value")))
:group 'tooltip) :group 'tooltip)
(defface tooltip (defface tooltip

View 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 (defcustom tree-widget-space-width 0.5
"Amount of space between an icon image and a node widget. "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 :group 'tree-widget
:type 'sexp) :type '(choice (number :tag "Multiple of normal character width")
sexp))
;;; Image support ;;; Image support
;; ;;

View 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 The command `type-break-guesstimate-keystroke-threshold' can be used to
guess a reasonably good pair of values for this variable." guess a reasonably good pair of values for this variable."
:set-after '(type-break-interval) :set-after '(type-break-interval)
:type 'sexp :type '(cons (choice integer (const nil)) (choice integer (const nil)))
:group 'type-break) :group 'type-break)
(defcustom type-break-query-function 'yes-or-no-p (defcustom type-break-query-function 'yes-or-no-p

View file

@ -752,7 +752,10 @@ Default is t."
"Imenu support for Sections and Subsections. "Imenu support for Sections and Subsections.
An alist with elements of the form (MENU-TITLE REGEXP INDEX) -- An alist with elements of the form (MENU-TITLE REGEXP INDEX) --
see the documentation for `imenu-generic-expression'." 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) :group 'woman-interface)
(defcustom woman-imenu nil (defcustom woman-imenu nil