unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Juanma Barranquero" <lekktu@gmail.com>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: Fload does not set the `autoload' property
Date: Sat, 13 Oct 2007 03:26:29 +0200	[thread overview]
Message-ID: <f7ccd24b0710121826g3597d3eehd277aa7b7410c959@mail.gmail.com> (raw)
In-Reply-To: <E1IgAXu-0004ey-5Q@fencepost.gnu.org>

On 10/12/07, Richard Stallman <rms@gnu.org> wrote:

> However, it might be a bug that this affects the `autoload' property.
> Maybe we should set the `autoload' property for every definition of a
> function that was previously autoloaded.

That's what I think; it is necessary in order to do a proper unload-feature.

> If we change this, we should consider it a bug fix,
> so we should do it now and fix it in Emacs 22.2.
> Would someone like to try implementing that change?

I would lie if I said I know anything about that part of the code.
Perhaps the attached patch is similar to what you're thinking about?

             Juanma


Index: src/data.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/data.c,v
retrieving revision 1.278
diff -c -r1.278 data.c
*** src/data.c	10 Sep 2007 09:41:44 -0000	1.278
--- src/data.c	13 Oct 2007 01:13:10 -0000
***************
*** 663,674 ****
       (symbol, definition)
       register Lisp_Object symbol, definition;
  {
    CHECK_SYMBOL (symbol);
    if (NILP (symbol) || EQ (symbol, Qt))
      xsignal1 (Qsetting_constant, symbol);
!   if (!NILP (Vautoload_queue) && !EQ (XSYMBOL (symbol)->function, Qunbound))
!     Vautoload_queue = Fcons (Fcons (symbol, XSYMBOL (symbol)->function),
! 			     Vautoload_queue);
    XSYMBOL (symbol)->function = definition;
    /* Handle automatic advice activation */
    if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol,
Qad_advice_info)))
--- 663,682 ----
       (symbol, definition)
       register Lisp_Object symbol, definition;
  {
+   register Lisp_Object function;
+
    CHECK_SYMBOL (symbol);
    if (NILP (symbol) || EQ (symbol, Qt))
      xsignal1 (Qsetting_constant, symbol);
!
!   function = XSYMBOL (symbol)->function;
!
!   if (!NILP (Vautoload_queue) && !EQ (function, Qunbound))
!     Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue);
!
!   if (CONSP (function) && EQ (XCAR (function), Qautoload))
!     Fput (symbol, Qautoload, XCDR (function));
!
    XSYMBOL (symbol)->function = definition;
    /* Handle automatic advice activation */
    if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol,
Qad_advice_info)))
Index: src/eval.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/eval.c,v
retrieving revision 1.291
diff -c -r1.291 eval.c
*** src/eval.c	9 Oct 2007 08:52:52 -0000	1.291
--- src/eval.c	13 Oct 2007 01:07:20 -0000
***************
*** 2178,2184 ****
       Lisp_Object fundef, funname;
  {
    int count = SPECPDL_INDEX ();
!   Lisp_Object fun, queue, first, second;
    struct gcpro gcpro1, gcpro2, gcpro3;

    /* This is to make sure that loadup.el gives a clear picture
--- 2178,2184 ----
       Lisp_Object fundef, funname;
  {
    int count = SPECPDL_INDEX ();
!   Lisp_Object fun;
    struct gcpro gcpro1, gcpro2, gcpro3;

    /* This is to make sure that loadup.el gives a clear picture
***************
*** 2199,2218 ****
    Vautoload_queue = Qt;
    Fload (Fcar (Fcdr (fundef)), Qnil, Qt, Qnil, Qt);

-   /* Save the old autoloads, in case we ever do an unload.  */
-   queue = Vautoload_queue;
-   while (CONSP (queue))
-     {
-       first = XCAR (queue);
-       second = Fcdr (first);
-       first = Fcar (first);
-
-       if (SYMBOLP (first) && CONSP (second) && EQ (XCAR (second), Qautoload))
- 	Fput (first, Qautoload, (XCDR (second)));
-
-       queue = XCDR (queue);
-     }
-
    /* Once loading finishes, don't undo it.  */
    Vautoload_queue = Qt;
    unbind_to (count, Qnil);
--- 2199,2204 ----

  parent reply	other threads:[~2007-10-13  1:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11  9:15 Fload does not set the 'autoload property Juanma Barranquero
2007-10-11 14:08 ` Stefan Monnier
2007-10-11 14:27   ` Juanma Barranquero
2007-10-12  2:46 ` Fload does not set the `autoload' property Richard Stallman
2007-10-12  4:06   ` Stefan Monnier
2007-10-13  1:26   ` Juanma Barranquero [this message]
2007-10-14 16:28     ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=f7ccd24b0710121826g3597d3eehd277aa7b7410c959@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.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 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).