changeset 17750:f11a3a49088c

(defcustom): Add doc-string-elt property. (make-autoload): Convert defcustom into defvar.
author Richard M. Stallman <rms@gnu.org>
date Mon, 12 May 1997 01:14:36 +0000
parents 52f0da9d19ff
children 01342565404e
files lisp/emacs-lisp/autoload.el
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/autoload.el	Mon May 12 01:03:02 1997 +0000
+++ b/lisp/emacs-lisp/autoload.el	Mon May 12 01:14:36 1997 +0000
@@ -32,8 +32,8 @@
 ;;; Code:
 
 (defun make-autoload (form file)
-  "Turn FORM, a defun or defmacro, into an autoload for source file FILE.
-Returns nil if FORM is not a defun, define-skeleton or defmacro."
+  "Turn FORM into an autoload or defvar for source file FILE.
+Returns nil if FORM is not a defun, define-skeleton, defmacro or defcustom."
   (let ((car (car-safe form)))
     (if (memq car '(defun define-skeleton defmacro))
 	(let ((macrop (eq car 'defmacro))
@@ -52,7 +52,12 @@
 		(or (eq car 'define-skeleton)
 		    (eq (car-safe (car form)) 'interactive))
 		(if macrop (list 'quote 'macro) nil)))
-      nil)))
+      (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))
+	nil))))
 
 (put 'define-skeleton 'doc-string-elt 3)
 
@@ -98,6 +103,7 @@
 (put 'autoload 'doc-string-elt 3)
 (put 'defun    'doc-string-elt 3)
 (put 'defvar   'doc-string-elt 3)
+(put 'defcustom 'doc-string-elt 3)
 (put 'defconst 'doc-string-elt 3)
 (put 'defmacro 'doc-string-elt 3)