From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lute Kamstra Newsgroups: gmane.emacs.devel Subject: Re: Removing unloaded functions from auto-mode-alist. Date: Mon, 25 Apr 2005 01:37:01 +0200 Message-ID: <87br83wxuq.fsf@xs4all.nl> References: <87zmvu6ba2.fsf@xs4all.nl> <85ll7e68ei.fsf@lola.goethe.zz> <854qe2ihhi.fsf@lola.goethe.zz> <85oecagzwf.fsf@lola.goethe.zz> <874qdvc48k.fsf@xs4all.nl> <85fyxfrjal.fsf@lola.goethe.zz> <87is2balna.fsf@xs4all.nl> <857jirrg1f.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1114386233 29224 80.91.229.2 (24 Apr 2005 23:43:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 24 Apr 2005 23:43:53 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 25 01:43:52 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DPqlK-0004qJ-VA for ged-emacs-devel@m.gmane.org; Mon, 25 Apr 2005 01:43:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DPqqk-0004eq-HH for ged-emacs-devel@m.gmane.org; Sun, 24 Apr 2005 19:49:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DPqpv-0004MJ-2t for emacs-devel@gnu.org; Sun, 24 Apr 2005 19:48:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DPqps-0004LI-TP for emacs-devel@gnu.org; Sun, 24 Apr 2005 19:48:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DPqps-0003u9-P1 for emacs-devel@gnu.org; Sun, 24 Apr 2005 19:48:24 -0400 Original-Received: from [194.109.24.27] (helo=smtp-vbr7.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DPqiB-0003lV-36; Sun, 24 Apr 2005 19:40:27 -0400 Original-Received: from pijl (a80-127-67-124.adsl.xs4all.nl [80.127.67.124]) by smtp-vbr7.xs4all.nl (8.12.11/8.12.11) with ESMTP id j3ONb2hM009743; Mon, 25 Apr 2005 01:37:02 +0200 (CEST) (envelope-from Lute.Kamstra@xs4all.nl) Original-Received: from lute by pijl with local (Exim 3.36 #1 (Debian)) id 1DPqes-0002oB-00; Mon, 25 Apr 2005 01:37:02 +0200 Original-To: David Kastrup In-Reply-To: <857jirrg1f.fsf@lola.goethe.zz> (David Kastrup's message of "Mon, 25 Apr 2005 00:00:44 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Original-Lines: 59 X-Virus-Scanned: by XS4ALL Virus Scanner 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:36351 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36351 David Kastrup writes: > Lute Kamstra writes: > >> David Kastrup writes: >> >>> Lute Kamstra writes: >>> >>>> Consider the following situation: >>>> >>>> function 'a is autoloaded: (autoload "blabla" ...). >>>> function 'b is autoloaded: (autoload "other" ...). >>>> function 'c is defined. >>>> function 'd is unbound. >>>> >>>> "blabla" defines 'a, 'b, 'c, and 'd as functions. >>>> >>>> Do (require 'blabla) and then (unload-feature 'blabla). >>>> >>>> Currently, all four functions will be unbound by unload-feature. >>>> You propose to let unload-feature restore both 'a and 'b to their >>>> previous autoloads [1]. >>> >>> Sure. >>> >>>> But what should be done with 'c? >>>> >>>> I think restoring 'c to its previous definition would be the right >>>> thing to do. >>> >>> Not at all. The purpose of unload-feature is to be able to restore >>> a state, most particular to conserve memory. So unload-feature >>> should not waste memory by keeping in effect a history of load >>> sequences around. Its purpose should be confined to unloading >>> those features that _can_ reasonably be unloaded. And that means >>> no functions whatsoever that _redefine_ stuff. The main purpose of >>> the autoload restoration is to restore autoloads into the package >>> itself, not foreign autoloads. >> >> For me, it is most intuitive/logical that unload-feature tries to >> undo the effects of loading the feature. > > If it can. > >> It is very uncommon that a feature redefines a function (or a >> variable), so keeping track of such cases will not waste much >> memory. > > But it is very common that one loads and evals one and the same file > over and over. We don't want to keep a history of that. I had not considered that. Does loading the same file more than once really happen often? On purpose? For what reason? If files do get reloaded often (for good reasons), then recording old values of functions and variables should probably be done only if require loads a file. That wouldn't happen twice. Lute.