Mercurial > emacs
comparison lisp/emacs-lisp/autoload.el @ 49100:b418e4d949ac
(make-autoload): Generate custom-autoload for autoloaded defcustoms.
author | Markus Rost <rost@math.uni-bielefeld.de> |
---|---|
date | Tue, 07 Jan 2003 18:39:14 +0000 |
parents | b2730a8dee9a |
children | 0d8b17d428b5 |
comparison
equal
deleted
inserted
replaced
49099:04672e32e3b0 | 49100:b418e4d949ac |
---|---|
106 easy-mmode-define-minor-mode | 106 easy-mmode-define-minor-mode |
107 define-minor-mode)) t) | 107 define-minor-mode)) t) |
108 (eq (car-safe (car body)) 'interactive)) | 108 (eq (car-safe (car body)) 'interactive)) |
109 (if macrop (list 'quote 'macro) nil)))) | 109 (if macrop (list 'quote 'macro) nil)))) |
110 | 110 |
111 ;; Convert defcustom to a simpler (and less space-consuming) defvar, | 111 ;; Convert defcustom to less space-consuming data. |
112 ;; but add some extra stuff if it uses :require. | |
113 ((eq car 'defcustom) | 112 ((eq car 'defcustom) |
114 (let ((varname (car-safe (cdr-safe form))) | 113 (let ((varname (car-safe (cdr-safe form))) |
115 (init (car-safe (cdr-safe (cdr-safe form)))) | 114 (init (car-safe (cdr-safe (cdr-safe form)))) |
116 (doc (car-safe (cdr-safe (cdr-safe (cdr-safe form))))) | 115 (doc (car-safe (cdr-safe (cdr-safe (cdr-safe form))))) |
117 (rest (cdr-safe (cdr-safe (cdr-safe (cdr-safe form)))))) | 116 ;; (rest (cdr-safe (cdr-safe (cdr-safe (cdr-safe form))))) |
118 (if (not (plist-get rest :require)) | 117 ) |
119 `(defvar ,varname ,init ,doc) | 118 `(progn |
120 `(progn | 119 (defvar ,varname ,init ,doc) |
121 (defvar ,varname ,init ,doc) | 120 (custom-autoload ',varname ,file)))) |
122 (custom-add-to-group ,(plist-get rest :group) | |
123 ',varname 'custom-variable) | |
124 (custom-add-load ',varname | |
125 ,(plist-get rest :require)))))) | |
126 | 121 |
127 ;; nil here indicates that this is not a special autoload form. | 122 ;; nil here indicates that this is not a special autoload form. |
128 (t nil)))) | 123 (t nil)))) |
129 | 124 |
130 ;; Forms which have doc-strings which should be printed specially. | 125 ;; Forms which have doc-strings which should be printed specially. |