[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fload does not set the `autoload' property
From: |
Juanma Barranquero |
Subject: |
Re: Fload does not set the `autoload' property |
Date: |
Sat, 13 Oct 2007 03:26:29 +0200 |
On 10/12/07, Richard Stallman <address@hidden> 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 ----