From ceaa369594356e7aae5e1539d9018092987e154c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 12 May 1997 01:14:36 +0000 Subject: [PATCH] (defcustom): Add doc-string-elt property. (make-autoload): Convert defcustom into defvar. --- lisp/emacs-lisp/autoload.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index bf5b5fffc42..5505b71b631 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -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 @@ Returns nil if FORM is not a defun, define-skeleton or defmacro." (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 @@ the section of autoloads for a file.") (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) -- 2.39.2