]> code.delx.au - gnu-emacs/blobdiff - lisp/custom.el
Add new function dom-remove-node
[gnu-emacs] / lisp / custom.el
index c5d0e65f42bfad340557fde71ba824821bd600be..056ca3411978dcc5e2824754565ea0339a6fb144 100644 (file)
@@ -1,6 +1,6 @@
 ;;; custom.el --- tools for declaring and initializing options
 ;;
-;; Copyright (C) 1996-1997, 1999, 2001-2015 Free Software Foundation,
+;; Copyright (C) 1996-1997, 1999, 2001-2016 Free Software Foundation,
 ;; Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
@@ -155,15 +155,14 @@ set to nil, as the value is no longer rogue."
     (unless (memq :group args)
       (custom-add-to-group (custom-current-group) symbol 'custom-variable))
     (while args
-      (let ((arg (car args)))
-       (setq args (cdr args))
-       (unless (symbolp arg)
+      (let ((keyword (pop args)))
+       (unless (symbolp keyword)
          (error "Junk in args %S" args))
-       (let ((keyword arg)
-             (value (car args)))
-         (unless args
-           (error "Keyword %s is missing an argument" keyword))
-         (setq args (cdr args))
+        (unless args
+          (error "Keyword %s is missing an argument" keyword))
+       (let ((value (pop args)))
+          ;; Can't use `pcase' because it is loaded after `custom.el'
+          ;; during bootstrap.  See `loadup.el'.
          (cond ((eq keyword :initialize)
                 (setq initialize value))
                ((eq keyword :set)
@@ -225,6 +224,7 @@ The remaining arguments to `defcustom' should have the form
 The following keywords are meaningful:
 
 :type  VALUE should be a widget type for editing the symbol's value.
+       Every `defcustom' should specify a value for this keyword.
 :options VALUE should be a list of valid members of the widget type.
 :initialize
        VALUE should be a function used to initialize the
@@ -411,8 +411,7 @@ In the ATTS property list, possible attributes are `:family',
 
 See Info node `(elisp) Faces' in the Emacs Lisp manual for more
 information."
-  (declare (doc-string 3)
-           (indent 1))
+  (declare (doc-string 3))
   ;; It is better not to use backquote in this file,
   ;; because that makes a bootstrapping problem
   ;; if you need to recompile all the Lisp files using interpreted code.
@@ -465,7 +464,7 @@ are not usually written so.
 MEMBERS should be an alist of the form ((NAME WIDGET)...) where
 NAME is a symbol and WIDGET is a widget for editing that symbol.
 Useful widgets are `custom-variable' for editing variables,
-`custom-face' for edit faces, and `custom-group' for editing groups.
+`custom-face' for editing faces, and `custom-group' for editing groups.
 
 The remaining arguments should have the form