Mercurial > hg > xemacs-beta
comparison lisp/autoload.el @ 646:00c54252fe4f
[xemacs-hg @ 2001-08-08 12:15:04 by didierv]
autoload.el: handle the case of
`define-derived-mode'.
author | didierv |
---|---|
date | Wed, 08 Aug 2001 12:15:04 +0000 |
parents | 87900685187b |
children | 2923009caf47 |
comparison
equal
deleted
inserted
replaced
645:87900685187b | 646:00c54252fe4f |
---|---|
41 | 41 |
42 (defun make-autoload (form file) | 42 (defun make-autoload (form file) |
43 "Turn FORM, a defun or defmacro, into an autoload for source file FILE. | 43 "Turn FORM, a defun or defmacro, into an autoload for source file FILE. |
44 Returns nil if FORM is not a defun, define-skeleton or defmacro." | 44 Returns nil if FORM is not a defun, define-skeleton or defmacro." |
45 (let ((car (car-safe form))) | 45 (let ((car (car-safe form))) |
46 (if (memq car '(defun define-skeleton defmacro)) | 46 (if (memq car '(defun define-skeleton defmacro define-derived-mode)) |
47 (let ((macrop (eq car 'defmacro)) | 47 (let ((macrop (eq car 'defmacro)) |
48 name doc) | 48 name doc) |
49 (setq form (cdr form) | 49 (setq form (cdr form) |
50 name (car form) | 50 name (car form) |
51 ;; Ignore the arguments. | 51 ;; Ignore the arguments. |
52 form (cdr (if (eq car 'define-skeleton) | 52 form (cdr (cond ((eq car 'define-skeleton) |
53 form | 53 form) |
54 (cdr form))) | 54 ((eq car 'define-derived-mode) |
55 (cddr form)) | |
56 (t | |
57 (cdr form)))) | |
55 doc (car form)) | 58 doc (car form)) |
56 (if (stringp doc) | 59 (if (stringp doc) |
57 (setq form (cdr form)) | 60 (setq form (cdr form)) |
58 (setq doc nil)) | 61 (setq doc nil)) |
59 (list 'autoload (list 'quote name) file doc | 62 (list 'autoload (list 'quote name) file doc |
60 (or (eq car 'define-skeleton) | 63 (or (eq car 'define-skeleton) |
64 (eq car 'define-derived-mode) | |
61 (eq (car-safe (car form)) 'interactive)) | 65 (eq (car-safe (car form)) 'interactive)) |
62 (if macrop (list 'quote 'macro) nil))) | 66 (if macrop (list 'quote 'macro) nil))) |
63 nil))) | 67 nil))) |
64 | 68 |
65 (put 'define-skeleton 'doc-string-elt 3) | 69 (put 'define-skeleton 'doc-string-elt 3) |