# HG changeset patch # User Richard M. Stallman # Date 870677064 0 # Node ID 962be4e083c2d5a2ce117aee7115fe94e91e167c # Parent 0c228cae75b5c62d6468f2f12b8d34f22b778377 (make-autoload): For a defcustom, generate custom-add-to-group and custom-add-load if needed. diff -r 0c228cae75b5 -r 962be4e083c2 lisp/emacs-lisp/autoload.el --- a/lisp/emacs-lisp/autoload.el Mon Aug 04 06:18:23 1997 +0000 +++ b/lisp/emacs-lisp/autoload.el Mon Aug 04 06:44:24 1997 +0000 @@ -52,11 +52,21 @@ (or (eq car 'define-skeleton) (eq (car-safe (car form)) 'interactive)) (if macrop (list 'quote 'macro) nil))) + ;; Convert defcustom to a simpler (and less space-consuming) defvar, + ;; but add some extra stuff if it uses :require. (if (eq car 'defcustom) (let ((varname (car-safe (cdr-safe form))) (init (car-safe (cdr-safe (cdr-safe form)))) - (doc (car-safe (cdr-safe (cdr-safe (cdr-safe form)))))) - (list 'defvar varname init doc)) + (doc (car-safe (cdr-safe (cdr-safe (cdr-safe form))))) + (rest (cdr-safe (cdr-safe (cdr-safe (cdr-safe form)))))) + (if (not (plist-get rest :require)) + `(defvar ,varname ,init ,doc) + `(progn + (defvar ,varname ,init ,doc) + (custom-add-to-group ,(plist-get rest :group) + ',varname 'custom-variable) + (custom-add-load ',varname + ,(plist-get rest :require))))) nil)))) (put 'define-skeleton 'doc-string-elt 3)