From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: Fload does not set the `autoload' property Date: Sat, 13 Oct 2007 03:26:29 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1192238816 20997 80.91.229.12 (13 Oct 2007 01:26:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 Oct 2007 01:26:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 13 03:26:44 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IgVm8-0002DS-9u for ged-emacs-devel@m.gmane.org; Sat, 13 Oct 2007 03:26:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IgVm2-0008Q6-1t for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2007 21:26:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IgVly-0008PF-Ar for emacs-devel@gnu.org; Fri, 12 Oct 2007 21:26:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IgVlu-0008P3-Uq for emacs-devel@gnu.org; Fri, 12 Oct 2007 21:26:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IgVlu-0008P0-Q7 for emacs-devel@gnu.org; Fri, 12 Oct 2007 21:26:30 -0400 Original-Received: from wx-out-0506.google.com ([66.249.82.228]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IgVlu-0000u9-Bk for emacs-devel@gnu.org; Fri, 12 Oct 2007 21:26:30 -0400 Original-Received: by wx-out-0506.google.com with SMTP id s7so948431wxc for ; Fri, 12 Oct 2007 18:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=15zzJdvS7KFSLvnMRt/19k002PNJRYO4veZsnGxmLpU=; b=nMbY4nFvWv0bOauJiemAQSA+hP+aWjgy3zlyYBx4TWvWHtOiF7UOoYNPfkcUnezMltB2vQ1z6zCMu0uE/9uvjysE6CAFDHzicoi+aJ3W4BTRRQYnoWKHFyHQQsaskwfsZ+I/dxqmLGjfdNcvkIoLrisK99mGSej6eT7RWi+YcaU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=OTObEgYm8jzWZ5u96hkRz+34ss5/57OQ2W/mrzcG8T/TCXpqnVYIo3W93vMtIuUDrmpe4vOkzPLQZ/3rixbnBEWhc90r5cQgkKcFZ6s6zofpRGmop7g8bWQ98ZNRf1XUY46zerSEP8IPlO3w0AJqxUZWh14D9nljxwoweFZJpCQ= Original-Received: by 10.90.118.12 with SMTP id q12mr5720631agc.1192238789738; Fri, 12 Oct 2007 18:26:29 -0700 (PDT) Original-Received: by 10.90.103.8 with HTTP; Fri, 12 Oct 2007 18:26:29 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80757 Archived-At: On 10/12/07, Richard Stallman 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 ----