all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Samuel Bronson <naesten@gmail.com>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: emacs-devel@gnu.org
Subject: May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs?
Date: Wed, 16 Nov 2011 13:25:34 -0500	[thread overview]
Message-ID: <CAJYzjmdKyPKQHTFVaRVLXD6b7HVamaB+GFV+4BFtWrVCosu3Lw@mail.gmail.com> (raw)

Dear Stephen,

I recently became aware that the following change is not present in
GNU Emacs. I would like to see this rectified. Would it be possible
for you to assign copyright on it to the FSF, if you have not already
done so? (Pretty please, with a cherry on top?)

P.s. Thanks for putting so much great work into XEmacs, even if it
might sometimes seem like a waste of effort.

# HG changeset patch
# User Stephen J. Turnbull <stephen@xemacs.org>
# Date 1198367841 28800
# Node ID d2f4dd8611d9b88d0c16de371bc663a99bc6a305
# Parent  bc3b9f61018efe778ecbbab927c5d8f37b60a629
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 bc3b9f61018e -r d2f4dd8611d9 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-22  Stephen J. Turnbull  <stephen@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@xemacs.org>

 	* autoload.el (process-one-lisp-autoload): Insert <immediate> into
diff -r bc3b9f61018e -r d2f4dd8611d9 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 @@
 ;; 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 @@
   (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 @@
 		      (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))



             reply	other threads:[~2011-11-16 18:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 18:25 Samuel Bronson [this message]
2011-11-16 19:19 ` May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs? Stephen J. Turnbull
2011-11-16 19:44   ` Samuel Bronson
2011-11-17  3:54     ` Stephen J. Turnbull
2011-11-17 12:20       ` Juanma Barranquero
2011-11-17 12:53         ` Stephen J. Turnbull
2011-11-18 20:38       ` Samuel Bronson
2011-11-19 14:15         ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJYzjmdKyPKQHTFVaRVLXD6b7HVamaB+GFV+4BFtWrVCosu3Lw@mail.gmail.com \
    --to=naesten@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=stephen@xemacs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.