Commit 5950a4fc authored by Karl Heuer's avatar Karl Heuer
Browse files

(make-autoload): Generate `(autoload ...)' form for

`(define-skeleton ...)'
parent 95b7ed48
...@@ -32,24 +32,29 @@ ...@@ -32,24 +32,29 @@
(defun make-autoload (form file) (defun make-autoload (form file)
"Turn FORM, a defun or defmacro, into an autoload for source file FILE. "Turn FORM, a defun or defmacro, into an autoload for source file FILE.
Returns nil if FORM is not a defun or defmacro." Returns nil if FORM is not a defun, define-skeleton or defmacro."
(let ((car (car-safe form))) (let ((car (car-safe form)))
(if (memq car '(defun defmacro)) (if (memq car '(defun define-skeleton defmacro))
(let ((macrop (eq car 'defmacro)) (let ((macrop (eq car 'defmacro))
name doc) name doc)
(setq form (cdr form)) (setq form (cdr form)
(setq name (car form)) name (car form)
;; Ignore the arguments. ;; Ignore the arguments.
(setq form (cdr (cdr form))) form (cdr (if (eq car 'define-skeleton)
(setq doc (car form)) form
(cdr form)))
doc (car form))
(if (stringp doc) (if (stringp doc)
(setq form (cdr form)) (setq form (cdr form))
(setq doc nil)) (setq doc nil))
(list 'autoload (list 'quote name) file doc (list 'autoload (list 'quote name) file doc
(eq (car-safe (car form)) 'interactive) (or (eq car 'define-skeleton)
(eq (car-safe (car form)) 'interactive))
(if macrop (list 'quote 'macro) nil))) (if macrop (list 'quote 'macro) nil)))
nil))) nil)))
(put 'define-skeleton 'doc-string-elt 3)
(defconst generate-autoload-cookie ";;;###autoload" (defconst generate-autoload-cookie ";;;###autoload"
"Magic comment indicating the following form should be autoloaded. "Magic comment indicating the following form should be autoloaded.
Used by \\[update-file-autoloads]. This string should be Used by \\[update-file-autoloads]. This string should be
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment