Mercurial > emacs
comparison lisp/emacs-lisp/autoload.el @ 22371:f3cf0507c362
*** empty log message ***
author | Dan Nicolaescu <done@ece.arizona.edu> |
---|---|
date | Sat, 06 Jun 1998 20:22:47 +0000 |
parents | 9a8adf8f1efa |
children | 4e1b3d1dac36 |
comparison
equal
deleted
inserted
replaced
22370:1f0dc0251be3 | 22371:f3cf0507c362 |
---|---|
59 (defconst generate-autoload-section-continuation ";;;;;; " | 59 (defconst generate-autoload-section-continuation ";;;;;; " |
60 "String to add on each continuation of the section header form.") | 60 "String to add on each continuation of the section header form.") |
61 | 61 |
62 (defun make-autoload (form file) | 62 (defun make-autoload (form file) |
63 "Turn FORM into an autoload or defvar for source file FILE. | 63 "Turn FORM into an autoload or defvar for source file FILE. |
64 Returns nil if FORM is not a `defun', `define-skeleton', `define-derived-mode', | 64 Returns nil if FORM is not a `defun', `define-skeleton', |
65 `defmacro' or `defcustom'." | 65 `define-derived-mode', `define-generic-mode', `defmacro', `defcustom' |
66 or `easy-mmode-define-minor-mode'." | |
66 (let ((car (car-safe form))) | 67 (let ((car (car-safe form))) |
67 (if (memq car '(defun define-skeleton defmacro define-derived-mode)) | 68 (if (memq car '(defun define-skeleton defmacro define-derived-mode |
69 define-generic-mode easy-mmode-define-minor-mode)) | |
68 (let ((macrop (eq car 'defmacro)) | 70 (let ((macrop (eq car 'defmacro)) |
69 name doc) | 71 name doc) |
70 (setq form (cdr form) | 72 (setq form (cdr form) |
71 name (car form) | 73 name (car form) |
72 ;; Ignore the arguments. | 74 ;; Ignore the arguments. |
73 form (cdr (cond | 75 form (cdr (cond |
74 ((eq car 'define-skeleton) form) | 76 ((memq car '(define-skeleton |
77 easy-mmode-define-minor-mode)) form) | |
75 ((eq car 'define-derived-mode) (cdr (cdr form))) | 78 ((eq car 'define-derived-mode) (cdr (cdr form))) |
79 ((eq car 'define-generic-mode) | |
80 (cdr (cdr (cdr (cdr (cdr form)))))) | |
76 (t (cdr form)))) | 81 (t (cdr form)))) |
77 doc (car form)) | 82 doc (car form)) |
78 (if (stringp doc) | 83 (if (stringp doc) |
79 (setq form (cdr form)) | 84 (setq form (cdr form)) |
80 (setq doc nil)) | 85 (setq doc nil)) |
81 (list 'autoload (list 'quote name) file doc | 86 ;; `define-generic-mode' quotes the name, so take care of that |
87 (list 'autoload (if (listp name) name (list 'quote name)) file doc | |
82 (or (eq car 'define-skeleton) (eq car 'define-derived-mode) | 88 (or (eq car 'define-skeleton) (eq car 'define-derived-mode) |
89 (eq car 'define-generic-mode) | |
90 (eq car 'easy-mmode-define-minor-mode) | |
83 (eq (car-safe (car form)) 'interactive)) | 91 (eq (car-safe (car form)) 'interactive)) |
84 (if macrop (list 'quote 'macro) nil))) | 92 (if macrop (list 'quote 'macro) nil))) |
85 ;; Convert defcustom to a simpler (and less space-consuming) defvar, | 93 ;; Convert defcustom to a simpler (and less space-consuming) defvar, |
86 ;; but add some extra stuff if it uses :require. | 94 ;; but add some extra stuff if it uses :require. |
87 (if (eq car 'defcustom) | 95 (if (eq car 'defcustom) |
97 ',varname 'custom-variable) | 105 ',varname 'custom-variable) |
98 (custom-add-load ',varname | 106 (custom-add-load ',varname |
99 ,(plist-get rest :require))))) | 107 ,(plist-get rest :require))))) |
100 nil)))) | 108 nil)))) |
101 | 109 |
102 (put 'define-skeleton 'doc-string-elt 3) | |
103 | |
104 ;;; Forms which have doc-strings which should be printed specially. | 110 ;;; Forms which have doc-strings which should be printed specially. |
105 ;;; A doc-string-elt property of ELT says that (nth ELT FORM) is | 111 ;;; A doc-string-elt property of ELT says that (nth ELT FORM) is |
106 ;;; the doc-string in FORM. | 112 ;;; the doc-string in FORM. |
107 ;;; | 113 ;;; |
108 ;;; There used to be the following note here: | 114 ;;; There used to be the following note here: |
123 (put 'defun 'doc-string-elt 3) | 129 (put 'defun 'doc-string-elt 3) |
124 (put 'defvar 'doc-string-elt 3) | 130 (put 'defvar 'doc-string-elt 3) |
125 (put 'defcustom 'doc-string-elt 3) | 131 (put 'defcustom 'doc-string-elt 3) |
126 (put 'defconst 'doc-string-elt 3) | 132 (put 'defconst 'doc-string-elt 3) |
127 (put 'defmacro 'doc-string-elt 3) | 133 (put 'defmacro 'doc-string-elt 3) |
134 (put 'define-skeleton 'doc-string-elt 3) | |
128 (put 'define-derived-mode 'doc-string-elt 4) | 135 (put 'define-derived-mode 'doc-string-elt 4) |
136 (put 'easy-mmode-define-minor-mode 'doc-string-elt 3) | |
137 (put 'define-generic-mode 'doc-string-elt 3) | |
129 | 138 |
130 | 139 |
131 (defun autoload-trim-file-name (file) | 140 (defun autoload-trim-file-name (file) |
132 ;; Returns a relative pathname of FILE | 141 ;; Returns a relative pathname of FILE |
133 ;; starting from the directory that loaddefs.el is in. | 142 ;; starting from the directory that loaddefs.el is in. |