From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Removing unloaded functions from auto-mode-alist. Date: Sun, 24 Apr 2005 00:10:51 +0200 Message-ID: <85fyxhcff8.fsf@lola.goethe.zz> References: <87zmvu6ba2.fsf@xs4all.nl> <85ll7e68ei.fsf@lola.goethe.zz> <854qe2ihhi.fsf@lola.goethe.zz> <8764yi4awh.fsf@xs4all.nl> <873btlsalu.fsf@xs4all.nl> <87pswo84vv.fsf@xs4all.nl> <857jiucz6r.fsf@lola.goethe.zz> <87oec5p5rq.fsf@xs4all.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1114294111 32281 80.91.229.2 (23 Apr 2005 22:08:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 23 Apr 2005 22:08:31 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 24 00:08:28 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DPSnQ-0006A8-8V for ged-emacs-devel@m.gmane.org; Sun, 24 Apr 2005 00:08:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DPSsc-00005R-GR for ged-emacs-devel@m.gmane.org; Sat, 23 Apr 2005 18:13:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DPSsR-0008UF-2d for emacs-devel@gnu.org; Sat, 23 Apr 2005 18:13:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DPSsO-0008Se-9y for emacs-devel@gnu.org; Sat, 23 Apr 2005 18:13:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DPSsO-0008Ow-7C for emacs-devel@gnu.org; Sat, 23 Apr 2005 18:13:24 -0400 Original-Received: from [151.189.21.45] (helo=mail-in-05.arcor-online.net) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DPStP-00004q-Jc; Sat, 23 Apr 2005 18:14:27 -0400 Original-Received: from lola.goethe.zz (i5387A6AF.versanet.de [83.135.166.175]) by mail-in-05.arcor-online.net (Postfix) with ESMTP id 95EAE10CBF5; Sun, 24 Apr 2005 00:11:06 +0200 (CEST) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 469661C1E222; Sun, 24 Apr 2005 00:10:52 +0200 (CEST) Original-To: Lute Kamstra In-Reply-To: <87oec5p5rq.fsf@xs4all.nl> (Lute Kamstra's message of "Sat, 23 Apr 2005 23:00:57 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:36310 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36310 Lute Kamstra writes: > David Kastrup writes: > >> The function that _clearly_ should trigger/use the recorded >> information, however, is "require". > > Agreed. > >> I don't think we need to make (load "filename") (unload-feature >>'filename) do anything sensible (and indeed it is legal to load the >>same file several times in succession), but it seems desirable to >>have (require 'filename) (unload-feature 'filename) form a proper >>pair. > > I'm not sure if it's the best solution not to let (load "filename") > record autoloads. Well, the idea explored a bit later later was that "load" will record autoloads, but not do anything with them by itself, instead letting "provide" handle it. > But letting only (require 'filename) record autoloads would be a big > improvement. My guess is that the vast majority of files get loaded > by do_autoload and Frequire. Furthermore, it seems quite easy to > implement the recording of autoloads in Frequire. I'll give it a > try and experiment with it for a while... > >> Unfortunately, this does not work well with the site-lisp.el >> construct >> (mapc 'load-file (directory-files "site-start.d" t ".el\\'")) >> >> So a better expedient would be to have >> (provide 'xxx) >> >> turn on the necessary action at the end of the current load file in >> case that the feature is provided the first time. >> >> This should be a pretty reliable way to do the recordings for files >> that are connected with a "feature". > > I'm not familiar with this. Could you elaborate? Many Emacs installations have a site-lisp/site-start.d directory. If you want some code executed automatically (usually a bunch of autoloads), then you'll drop the .el file in that directory. > When is this used? Does it load files that define functions that > replace autoloads? I guess the most common case would be loading files that _place_ autoloads and add stuff to hook functions. And it usually is a bunch of stuff that the system administrator thought good for you. For example, if you install a prepackaged foobar package from your favorite distribution, then this will drop foobar.el into site-lisp/site-start.d/ and foobar.el will then setup the package foobar with autoloads and similar. If the wisdom of the system provider did not match your personal tastes, being able to (unload-feature 'foobar) would be definitely nice. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum