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: Wed, 20 Apr 2005 21:22:13 +0200 Message-ID: <87hdi1b6e2.fsf@xs4all.nl> References: <87zmvu6ba2.fsf@xs4all.nl> <85ll7e68ei.fsf@lola.goethe.zz> <854qe2ihhi.fsf@lola.goethe.zz> <85oecagzwf.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 1114024834 3148 80.91.229.2 (20 Apr 2005 19:20:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 20 Apr 2005 19:20:34 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 20 21:20:31 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DOKjY-0005hC-3U for ged-emacs-devel@m.gmane.org; Wed, 20 Apr 2005 21:19:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DOKo7-0007Ff-0P for ged-emacs-devel@m.gmane.org; Wed, 20 Apr 2005 15:24:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DOKnx-0007FN-Cn for emacs-devel@gnu.org; Wed, 20 Apr 2005 15:24:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DOKnv-0007EW-AR for emacs-devel@gnu.org; Wed, 20 Apr 2005 15:24:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DOKnt-0006v3-EJ for emacs-devel@gnu.org; Wed, 20 Apr 2005 15:24:06 -0400 Original-Received: from [194.109.24.23] (helo=smtp-vbr3.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DOKod-00038x-Vj; Wed, 20 Apr 2005 15:24:52 -0400 Original-Received: from pijl (a80-127-67-124.adsl.xs4all.nl [80.127.67.124]) by smtp-vbr3.xs4all.nl (8.12.11/8.12.11) with ESMTP id j3KJMEtS047977; Wed, 20 Apr 2005 21:22:14 +0200 (CEST) (envelope-from Lute.Kamstra@xs4all.nl) Original-Received: from lute by pijl with local (Exim 3.36 #1 (Debian)) id 1DOKm5-0001CC-00; Wed, 20 Apr 2005 21:22:13 +0200 Original-To: David Kastrup In-Reply-To: <85oecagzwf.fsf@lola.goethe.zz> (David Kastrup's message of "Wed, 20 Apr 2005 00:33:36 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Original-Lines: 36 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:36186 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36186 David Kastrup writes: [...] >>> Won't work. Autoloads corresponding to a different file than the >>> loaded one don't get restored. >> >> That's a bug which we should fix. > > I am not sure it is a bug. If I load several packages redefining one > symbol, and then unload _one_ of those packages, is it a good idea if > the symbol gets restored to an autoload? To be sure we're talking about the same thing: The problem is not that "autoloads corresponding to a different file than the loaded one don't get restored." The problem is that loading a file (either by means of load or by means of require) doesn't record the old autoloads. Consider this case: apropos is autoloaded; something does (require 'apropos) and apropos.el gets loaded without recording the autoload; you do (unload-feature 'apropos); apropos is now not bound as a function. >> In the mean time, you can use an auctex-override-unload-hook to >> re-install the autoloads. > > This hook is not available in XEmacs or in Emacs 21.3. And the normal > auctex-unload-hook is getting run before symbols are fmakunbound, so > can't restore the autoloads permanently. FEATURE-unload-hook is called by (unload-feature FEATURE). It is used in Emacs since version 20.4. You can use it to restore autoloads by setting the autoload property of function symbols. But you're using undocumented inside knowledge in that case. Lute.