]> code.delx.au - gnu-emacs/commitdiff
Improve the custom type of some user options.
authorGlenn Morris <rgm@gnu.org>
Tue, 2 Feb 2016 01:59:32 +0000 (20:59 -0500)
committerGlenn Morris <rgm@gnu.org>
Tue, 2 Feb 2016 01:59:32 +0000 (20:59 -0500)
* lisp/autoinsert.el (auto-insert-alist):
* lisp/replace.el (query-replace-from-to-separator):
* lisp/gnus/gnus-art.el (gnus-hidden-properties):
* lisp/gnus/gnus-gravatar.el (gnus-gravatar-properties):
* lisp/gnus/gnus-picon.el (gnus-picon-properties):
* lisp/progmodes/prolog.el (prolog-keywords, prolog-types)
(prolog-mode-specificators, prolog-determinism-specificators)
(prolog-directives, prolog-program-name, prolog-program-switches)
(prolog-consult-string, prolog-compile-string, prolog-eof-string)
(prolog-prompt-regexp): Improve custom type.

lisp/autoinsert.el
lisp/gnus/gnus-art.el
lisp/gnus/gnus-gravatar.el
lisp/gnus/gnus-picon.el
lisp/progmodes/prolog.el
lisp/replace.el

index e5dd62ff4d89d51e4d0b3beee3d23ec5ea5f3867..43fa31288e68c9b599366fa531a30a7cbddefe2f 100644 (file)
@@ -305,7 +305,17 @@ ACTION may be a skeleton to insert (see `skeleton-insert'), an absolute
 file-name or one relative to `auto-insert-directory' or a function to call.
 ACTION may also be a vector containing several successive single actions as
 described above, e.g. [\"header.insert\" date-and-author-update]."
-  :type 'sexp
+  :type '(alist :key-type
+                (choice (regexp :tag "Regexp matching file name")
+                        (symbol :tag "Major mode")
+                        (cons :tag "Condition and description"
+                              (choice :tag "Condition"
+                               (regexp :tag "Regexp matching file name")
+                               (symbol :tag "Major mode"))
+                              (string :tag "Description")))
+                ;; There's no custom equivalent of "repeat" for vectors.
+                :value-type (choice file function
+                                    (sexp :tag "Skeleton or vector")))
   :version "25.1"
   :group 'auto-insert)
 
index 54bbfd857f15d9997d0a21de8b85dedc3c75a1cd..366d14aca1d026f27cd313a852f89eeb7f3c8003 100644 (file)
@@ -260,7 +260,7 @@ This can also be a list of the above values."
   ;; needed there.  And XEmacs doesn't handle `intangible' anyway.
   '(invisible t)
   "Property list to use for hiding text."
-  :type 'sexp
+  :type 'plist
   :group 'gnus-article-hiding)
 
 ;; Fixme: This isn't the right thing for mixed graphical and non-graphical
index deb6e4bc4c9f3a3956526e3786b28da8d81ff282..de7203d9d10d6a4708b8750b64232eb5bb853b03 100644 (file)
@@ -41,7 +41,7 @@ If nil, default to `gravatar-size'."
 
 (defcustom gnus-gravatar-properties '(:ascent center :relief 1)
   "List of image properties applied to Gravatar images."
-  :type 'sexp
+  :type 'plist
   :version "24.1"
   :group 'gnus-gravatar)
 
index 6365e8e2ff7a659b77f0b06c79591f262bce6242..bbbe0eded4e69c20b2acf200d425ebb2be0a43ad 100644 (file)
@@ -73,7 +73,7 @@ Some people may want to add \"unknown\" to this list."
 
 (defcustom gnus-picon-properties '(:color-symbols (("None" . "white")))
   "List of image properties applied to picons."
-  :type 'sexp
+  :type 'plist
   :version "24.3"
   :group 'gnus-picon)
 
index 4f23f87dd5911a70ead36928f6045a4b770baeef..9c15f3b6a0ef89d3a21f3d1dc4b314e0a0d6a1fc 100644 (file)
 ;; Version 0.1.35:
 ;;  o  Minor font-lock bug fixes.
 
-;;; TODO:
-
-;; Replace ":type 'sexp" with more precise Custom types.
 \f
 ;;; Code:
 
@@ -441,7 +438,12 @@ Legal values:
   "Alist of Prolog keywords which is used for font locking of directives."
   :version "24.1"
   :group 'prolog-font-lock
-  :type 'sexp
+  ;; Note that "(repeat string)" also allows "nil" (repeat-count 0).
+  ;; This gets processed by prolog-find-value-by-system, which
+  ;; allows both the car and the cdr to be a list to eval.
+  ;; Though the latter must have the form '(eval ...)'.
+  ;; Of course, none of this is documented...
+  :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
   :risky t)
 
 (defcustom prolog-types
@@ -451,7 +453,7 @@ Legal values:
   "Alist of Prolog types used by font locking."
   :version "24.1"
   :group 'prolog-font-lock
-  :type 'sexp
+  :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
   :risky t)
 
 (defcustom prolog-mode-specificators
@@ -461,7 +463,7 @@ Legal values:
   "Alist of Prolog mode specificators used by font locking."
   :version "24.1"
   :group 'prolog-font-lock
-  :type 'sexp
+  :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
   :risky t)
 
 (defcustom prolog-determinism-specificators
@@ -472,7 +474,7 @@ Legal values:
   "Alist of Prolog determinism specificators used by font locking."
   :version "24.1"
   :group 'prolog-font-lock
-  :type 'sexp
+  :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
   :risky t)
 
 (defcustom prolog-directives
@@ -482,7 +484,7 @@ Legal values:
   "Alist of Prolog source code directives used by font locking."
   :version "24.1"
   :group 'prolog-font-lock
-  :type 'sexp
+  :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
   :risky t)
 
 
@@ -569,7 +571,8 @@ the first column (i.e., DCG heads) inserts ` -->' and newline."
          (or (car names) "prolog"))))
   "Alist of program names for invoking an inferior Prolog with `run-prolog'."
   :group 'prolog-inferior
-  :type 'sexp
+  :type '(alist :key-type (choice symbol sexp)
+                :value-type (group (choice string (const nil) sexp)))
   :risky t)
 (defun prolog-program-name ()
   (prolog-find-value-by-system prolog-program-name))
@@ -580,7 +583,7 @@ the first column (i.e., DCG heads) inserts ` -->' and newline."
   "Alist of switches given to inferior Prolog run with `run-prolog'."
   :version "24.1"
   :group 'prolog-inferior
-  :type 'sexp
+  :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
   :risky t)
 (defun prolog-program-switches ()
   (prolog-find-value-by-system prolog-program-switches))
@@ -604,7 +607,8 @@ Some parts of the string are replaced:
      region of a buffer, in which case it is the number of lines before
      the region."
   :group 'prolog-inferior
-  :type 'sexp
+  :type '(alist :key-type (choice symbol sexp)
+                :value-type (group (choice string (const nil) sexp)))
   :risky t)
 
 (defun prolog-consult-string ()
@@ -631,17 +635,21 @@ Some parts of the string are replaced:
 If `prolog-program-name' is non-nil, it is a string sent to a Prolog process.
 If `prolog-program-name' is nil, it is an argument to the `compile' function."
   :group 'prolog-inferior
-  :type 'sexp
+  :type '(alist :key-type (choice symbol sexp)
+                :value-type (group (choice string (const nil) sexp)))
   :risky t)
 
 (defun prolog-compile-string ()
   (prolog-find-value-by-system prolog-compile-string))
 
 (defcustom prolog-eof-string "end_of_file.\n"
-  "Alist of strings that represent end of file for prolog.
-nil means send actual operating system end of file."
+  "String or alist of strings that represent end of file for prolog.
+If nil, send actual operating system end of file."
   :group 'prolog-inferior
-  :type 'sexp
+  :type '(choice string
+                 (const nil)
+                 (alist :key-type (choice symbol sexp)
+                        :value-type (group (choice string (const nil) sexp))))
   :risky t)
 
 (defcustom prolog-prompt-regexp
@@ -653,7 +661,8 @@ nil means send actual operating system end of file."
   "Alist of prompts of the prolog system command line."
   :version "24.1"
   :group 'prolog-inferior
-  :type 'sexp
+  :type '(alist :key-type (choice symbol sexp)
+                :value-type (group (choice string (const nil) sexp)))
   :risky t)
 
 (defun prolog-prompt-regexp ()
@@ -664,7 +673,8 @@ nil means send actual operating system end of file."
 ;;     (t "^|: +"))
 ;;   "Alist of regexps matching the prompt when consulting `user'."
 ;;   :group 'prolog-inferior
-;;   :type 'sexp
+;;   :type '(alist :key-type (choice symbol sexp)
+;;                :value-type (group (choice string (const nil) sexp)))
 ;;   :risky t)
 
 (defcustom prolog-debug-on-string "debug.\n"
index f5c8d33b5f56ab990adde2266c409a956aa6903e..dfe8cd739a2ae3fe4968202df49dd36ea9c0b4da 100644 (file)
@@ -85,7 +85,7 @@ from Isearch by using a key sequence like `C-s C-s M-%'." "24.3")
   ;; while preparing to dump, also stops customize-rogue listing this.
   :initialize 'custom-initialize-delay
   :group 'matching
-  :type 'sexp
+  :type '(choice string (sexp :tag "Display specification"))
   :version "25.1")
 
 (defcustom query-replace-from-history-variable 'query-replace-history