unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs?
@ 2011-11-16 18:25 Samuel Bronson
  2011-11-16 19:19 ` Stephen J. Turnbull
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Bronson @ 2011-11-16 18:25 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: emacs-devel

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))



^ permalink raw reply	[flat|nested] 8+ messages in thread

* May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs?
  2011-11-16 18:25 May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs? Samuel Bronson
@ 2011-11-16 19:19 ` Stephen J. Turnbull
  2011-11-16 19:44   ` Samuel Bronson
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen J. Turnbull @ 2011-11-16 19:19 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: emacs-devel

Samuel Bronson writes:
 > 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?)

I assigned my XEmacs code to the FSF around 1998.  If the assignment
is not on file, I have my copy around somewhere.

Note that the code that this patch patches was written by Ben Wing in
2005 (Mercurial r2548).  From the patch and the style I would say it
was written by him from scratch.  So you're welcome to any snippets of
mine that work with Emacs, such as the defvars, but the patch surely
won't apply to Emacs, and you'd have to rewrite the parts that *use*
the variables I defined anyway, as Ben never assigned his code.  He's
often expressed willingness to do so under the right conditions; I
don't know if this would qualify, but I suspect it would.  However, I
don't know where Ben is at the moment, so tracking him down might take
more effort than it's worth for the two or three uses of those
variables.

Regards,
Steve



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs?
  2011-11-16 19:19 ` Stephen J. Turnbull
@ 2011-11-16 19:44   ` Samuel Bronson
  2011-11-17  3:54     ` Stephen J. Turnbull
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Bronson @ 2011-11-16 19:44 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: emacs-devel

On Wed, Nov 16, 2011 at 2:19 PM, Stephen J. Turnbull <stephen@xemacs.org> wrote:
> Samuel Bronson writes:
>  > 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?)
>
> I assigned my XEmacs code to the FSF around 1998.  If the assignment
> is not on file, I have my copy around somewhere.
>
> Note that the code that this patch patches was written by Ben Wing in
> 2005 (Mercurial r2548).  From the patch and the style I would say it
> was written by him from scratch.  So you're welcome to any snippets of
> mine that work with Emacs, such as the defvars, but the patch surely
> won't apply to Emacs, and you'd have to rewrite the parts that *use*
> the variables I defined anyway, as Ben never assigned his code.  He's
> often expressed willingness to do so under the right conditions; I
> don't know if this would qualify, but I suspect it would.  However, I
> don't know where Ben is at the moment, so tracking him down might take
> more effort than it's worth for the two or three uses of those
> variables.

While it's true that the patch won't quite apply cleanly, the
`make-autoload' functions appear to actually have the same structure
(including comments). A human could easily apply it it, making the
necessary adjustments for differences in the actual contents of the
lists. (I guess Ben already assigned copyright to the FSF?)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs?
  2011-11-16 19:44   ` Samuel Bronson
@ 2011-11-17  3:54     ` Stephen J. Turnbull
  2011-11-17 12:20       ` Juanma Barranquero
  2011-11-18 20:38       ` Samuel Bronson
  0 siblings, 2 replies; 8+ messages in thread
From: Stephen J. Turnbull @ 2011-11-17  3:54 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: emacs-devel

Samuel Bronson writes:
 > On Wed, Nov 16, 2011 at 2:19 PM, Stephen J. Turnbull <stephen@xemacs.org> wrote:
 > > Samuel Bronson writes:
 > >  > Dear Stephen,
 > >  >
 > >  > I recently became aware that the following change is not present in
 > >  > GNU Emacs. I would like to see this rectified.
 > >
 > > I assigned my XEmacs code to the FSF around 1998.  If the assignment
 > > is not on file, I have my copy around somewhere.
 > >
 > > Note that the code that this patch patches was written by Ben Wing in
 > > 2005 (Mercurial r2548).
 > 
 > While it's true that the patch won't quite apply cleanly, the
 > `make-autoload' functions appear to actually have the same structure
 > (including comments). A human could easily apply it it, making the
 > necessary adjustments for differences in the actual contents of the
 > lists. (I guess Ben already assigned copyright to the FSF?)

No!  Ben hasn't assigned copyright as far as I know; you'd have to
check with the FSF copyright clerk or him, but although he's expressed
willingness to assign *all* of his code, he attached conditions that
never were satisfied.  I suspect he would assign small parts if he
were asked.

My code is entirely original (as far as replacing hard-coded data with
a variable reference can be considered "original" :-), and you're more
than welcome to the docstrings (although the GNU Emacs Docstring
Police will probably have something to say about style).

You'd have to ask a lawyer to be sure, but ISTM that there should be
no copyright problems if you insert my defvars (as permitted by GPL
and conforms to GNU Emacs policy by my assignment).  Then adjust the
contents to GNU Emacs reality and then go figure out where to use them
for yourself (your original contribution).  You only need an
assignment from Ben if you also copy surrounding code from XEmacs for
some reason.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs?
  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
  1 sibling, 1 reply; 8+ messages in thread
From: Juanma Barranquero @ 2011-11-17 12:20 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: Samuel Bronson, emacs-devel

On Thu, Nov 17, 2011 at 04:54, Stephen J. Turnbull <stephen@xemacs.org> wrote:

> (although the GNU Emacs Docstring
> Police will probably have something to say about style).

They are a nasty bunch, these GEDP boys.

    Juanma



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs?
  2011-11-17 12:20       ` Juanma Barranquero
@ 2011-11-17 12:53         ` Stephen J. Turnbull
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen J. Turnbull @ 2011-11-17 12:53 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Samuel Bronson, emacs-devel

Juanma Barranquero writes:
 > On Thu, Nov 17, 2011 at 04:54, Stephen J. Turnbull <stephen@xemacs.org> wrote:
 > 
 > > (although the GNU Emacs Docstring
 > > Police will probably have something to say about style).
 > 
 > They are a nasty bunch, these GEDP boys.

I wouldn't go so far as to say that, but Stefan's views on good style
in documentation are quite different from mine in some ways.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs?
  2011-11-17  3:54     ` Stephen J. Turnbull
  2011-11-17 12:20       ` Juanma Barranquero
@ 2011-11-18 20:38       ` Samuel Bronson
  2011-11-19 14:15         ` Stephen J. Turnbull
  1 sibling, 1 reply; 8+ messages in thread
From: Samuel Bronson @ 2011-11-18 20:38 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: emacs-devel

On Wed, Nov 16, 2011 at 10:54 PM, Stephen J. Turnbull
<stephen@xemacs.org> wrote:
> Samuel Bronson writes:

>  > While it's true that the patch won't quite apply cleanly, the
>  > `make-autoload' functions appear to actually have the same structure
>  > (including comments). A human could easily apply it it, making the
>  > necessary adjustments for differences in the actual contents of the
>  > lists. (I guess Ben already assigned copyright to the FSF?)
>
> No!  Ben hasn't assigned copyright as far as I know; you'd have to
> check with the FSF copyright clerk or him, but although he's expressed
> willingness to assign *all* of his code, he attached conditions that
> never were satisfied.  I suspect he would assign small parts if he
> were asked.

While this leaves me rather puzzled as to how the code to which I wish
to apply your refactoring came to be in GNU Emacs, the important thing
is that it *is* here and the refactoring *is* applicable.

> My code is entirely original (as far as replacing hard-coded data with
> a variable reference can be considered "original" :-), and you're more
> than welcome to the docstrings (although the GNU Emacs Docstring
> Police will probably have something to say about style).
>
> You'd have to ask a lawyer to be sure, but ISTM that there should be
> no copyright problems if you insert my defvars (as permitted by GPL
> and conforms to GNU Emacs policy by my assignment).  Then adjust the
> contents to GNU Emacs reality and then go figure out where to use them
> for yourself (your original contribution).  You only need an
> assignment from Ben if you also copy surrounding code from XEmacs for
> some reason.

Again, `make-autoload' is already here, structurally the same as in
XEmacs prior to the patch, so it looks like I'm good to start on this.

I suppose I will have to bring my own copyright assignment papers up
to date at some point, though, now that I've graduated from college.
It would be nice if somebody could tell me how to do that.


This all started because I kept whining in #emacs about
package.el/autoload.el not supporting autoload generation for custom
defun-like macros properly, after I tried to install Icicles from
Marmalade. (It turns out that I already had a Debian package installed
for it anyway, but that's not really the point of this: the point is
that it should be possible to install such packages using package.el.)

Tom Tromey had said this to say:

Nov 16 12:19:37 <tromey> if you fix autoload.el, the rest will follow

... and so I decided to see what I could do.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs?
  2011-11-18 20:38       ` Samuel Bronson
@ 2011-11-19 14:15         ` Stephen J. Turnbull
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen J. Turnbull @ 2011-11-19 14:15 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: emacs-devel

Samuel Bronson writes:

 > While this leaves me rather puzzled as to how the code to which I wish
 > to apply your refactoring came to be in GNU Emacs, the important thing
 > is that it *is* here and the refactoring *is* applicable.

Oh, that's very easy to explain.  We need our code to work with
programs written for Emacs, so semantics of code that affects
3rd-party packages can't vary much from Emacs.  The spec and original
implementation of autoload.el were inherited from Emacs (Roland
McGrath wrote the original, I think), but Ben's code is usually
entirely new except where he states in the ChangeLog that it was a
sync.  In this case there's no such note, so I assume (to be on the
safe side of the Emacs assignment policy) that Ben wrote the
implementation we're currently using since he's the one who installed
the code.

 > I suppose I will have to bring my own copyright assignment papers up
 > to date at some point, though, now that I've graduated from college.
 > It would be nice if somebody could tell me how to do that.

If Stefan or Yidong doesn't pick up on this message write them
directly and they'll get the copyright clerk to send you the necessary
forms.

 > This all started because I kept whining in #emacs about
 > package.el/autoload.el not supporting autoload generation for custom
 > defun-like macros properly,

Well there you go!





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-11-19 14:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 18:25 May your change "Factor out lists of operators specially treated by 'make-autoload'." be added to Emacs? Samuel Bronson
2011-11-16 19:19 ` 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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).