changeset: 4352:d2f4dd8611d9b88d0c16de371bc663a99bc6a305
tag: tip
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sat Dec 22 15:57:21 2007 -0800
files: lisp/ChangeLog lisp/autoload.el
description:
Factor out lists of operators specially treated by 'make-autoload'.
General idea approved by Mike Sperber, and tested in 21.4 by building JDE.
diff -r bc3b9f61018efe778ecbbab927c5d8f37b60a629 -r
d2f4dd8611d9b88d0c16de371bc663a99bc6a305 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Dec 22 15:02:04 2007 +0100
+++ b/lisp/ChangeLog Sat Dec 22 15:57:21 2007 -0800
@@ -1,3 +1,11 @@ 2007-12-18 Mike Sperber <mike(a)xemacs.o
+2007-12-22 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Factor out lists of operators specially treated by `make-autoload'.
+
+ * autoload.el (autoload-make-autoload-operators): New.
+ (autoload-make-autoload-complex-operators): New.
+ (make-autoload): Use them.
+
2007-12-18 Mike Sperber <mike(a)xemacs.org>
* autoload.el (process-one-lisp-autoload): Insert <immediate> into
diff -r bc3b9f61018efe778ecbbab927c5d8f37b60a629 -r
d2f4dd8611d9b88d0c16de371bc663a99bc6a305 lisp/autoload.el
--- a/lisp/autoload.el Sat Dec 22 15:02:04 2007 +0100
+++ b/lisp/autoload.el Sat Dec 22 15:57:21 2007 -0800
@@ -226,6 +226,20 @@ the section of autoloads for a file.")
;; Parsing the source file text.
;; Autoloads in C source differ from those in Lisp source.
+;; #### Eventually operators like defclass and defmethod (defined in an
+;; external package, EIEIO) may be factored out. Don't add operators here
+;; without discussing whether and how to do that on the developers' channel.
+(defvar autoload-make-autoload-operators
+ '(defun define-skeleton defmacro define-derived-mode define-generic-mode
+ easy-mmode-define-minor-mode easy-mmode-define-global-mode
+ define-minor-mode defun* defmacro* defclass defmethod)
+ "`defun'-like operators that use `autoload' to load the library.")
+
+(defvar autoload-make-autoload-complex-operators
+ '(easy-mmode-define-minor-mode easy-mmode-define-global-mode
+ define-minor-mode)
+ "`defun'-like operators to macroexpand before using `autoload'.")
+
(defun make-autoload (form file)
"Turn FORM into an autoload or defvar for source file FILE.
Returns nil if FORM is not a special autoload form (i.e. a function definition
@@ -233,8 +247,7 @@ or macro definition or a defcustom)."
(let ((car (car-safe form)) expand)
(cond
;; For complex cases, try again on the macro-expansion.
- ((and (memq car '(easy-mmode-define-global-mode
- easy-mmode-define-minor-mode define-minor-mode))
+ ((and (memq car autoload-make-autoload-complex-operators)
(setq expand (let ((load-file-name file)) (macroexpand form)))
(eq (car expand) 'progn)
(memq :autoload-end expand))
@@ -246,11 +259,7 @@ or macro definition or a defcustom)."
(cdr expand)))))
;; For special function-like operators, use the `autoload' function.
- ((memq car '(defun define-skeleton defmacro define-derived-mode
- define-generic-mode easy-mmode-define-minor-mode
- easy-mmode-define-global-mode
- define-minor-mode defun* defmacro*
- defclass defmethod)) ; from the EIEIO package
+ ((memq car autoload-make-autoload-operators)
(let* ((macrop (memq car '(defmacro defmacro*)))
(name (nth 1 form))
(body (nthcdr (get car 'doc-string-elt) form))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches