From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "paul r" Newsgroups: gmane.emacs.devel Subject: Re: Feature Request : autoload-form Date: Mon, 31 Mar 2008 19:36:53 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1206985035 18194 80.91.229.12 (31 Mar 2008 17:37:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Mar 2008 17:37:15 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 31 19:37:46 2008 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 1JgNwx-0006nq-7M for ged-emacs-devel@m.gmane.org; Mon, 31 Mar 2008 19:37:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JgNwL-0000MP-6f for ged-emacs-devel@m.gmane.org; Mon, 31 Mar 2008 13:37:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JgNwH-0000M9-Dz for emacs-devel@gnu.org; Mon, 31 Mar 2008 13:36:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JgNwG-0000Lx-0I for emacs-devel@gnu.org; Mon, 31 Mar 2008 13:36:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JgNwF-0000Lu-QG for emacs-devel@gnu.org; Mon, 31 Mar 2008 13:36:55 -0400 Original-Received: from fk-out-0910.google.com ([209.85.128.191]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JgNwF-0000NO-8o for emacs-devel@gnu.org; Mon, 31 Mar 2008 13:36:55 -0400 Original-Received: by fk-out-0910.google.com with SMTP id 26so2389368fkx.10 for ; Mon, 31 Mar 2008 10:36:54 -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=YxxA0moqH7PmPf+YK3naUG6ot1i7zX7Tm9yMrbJdSS0=; b=iIjjydwZYOuVjl8Q4oMtvzWDOL3vPa2BNA32gfMhHgaYxGtJcz8Cm6a1fg9F+oCsox7KSYXemvT/76LK9sLXSje4by3qRe9dWafF+L6mL72TPgXr9D9d+TRDy80A0r37yRTPXRZIxikCWvMyibojLIiAOxUhiPVY32GBRe9voJU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QnxHTnmIeMDQGgq6ZvbIt42Bag5rEPbpm7DoEfEYSqa9zUpzU5iQ53mQ5z5fmpnG8F4J0p6IpNgoZAoQCiAf2MU6EndC4nZmGDlqhAz2DVm0gVW0ihDs64Xvb6sM2VFfgURwcQduAfdV22BMPIq8NT4+R7fKA5NOr8Rdw/5LFJI= Original-Received: by 10.82.139.20 with SMTP id m20mr16347028bud.16.1206985014064; Mon, 31 Mar 2008 10:36:54 -0700 (PDT) Original-Received: by 10.82.175.3 with HTTP; Mon, 31 Mar 2008 10:36:53 -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:94050 Archived-At: 2008/3/31, Richard Stallman : I'll try to make things more clear below, but before reading the whole message, be warned : - it is long and unlikely to interest you, so you can safely skip it - I solved the original problem of this thread. > I think I understand what these do. I'm not completely sure why you > want them, though. What job do these do, which you couldn't do by > installing some Lisp libraries in the usual way? What usual way ? > > Why not put this stuff directly in .emacs? TidyConfig IS a .emacs splited into many files. Each file has a role. You may want to load some of them, and not some others. As an exemple, the upstream repository provides more than 20 modules, but usualy people use around 10 modules. For exemple, you can load 4 of them at startup time, then the 6 remaining dynamically when needed (thanks to autoload / automode etc). Any configuration should not be read -at all- if not needed yet. > I don't see why you want to do that, rather than putting the > "module configuration" expressions directly in .emacs. > What do you gain? Fine grained, per-feature, configuration "cherry-picking". But you are right that I could. > I am confused. Are you talking about making a module load its module > configuration expressions, or are you talking about how to load the > module itself when it is needed? Those are two different issues, right? > Some of your words seem to imply one, and some seem to imply the other. Sorry for not being clear. This system uses some conventions. Here is an exemple of a use case : - I sometime use latex-mode - I do not want it to be loaded at startup time because it would slow down for nothing - Some of the configuration should be shared with other users To do so : - I have some customization for this mode, that is shared by everybody in my company. This configuration is some lisp written in mod.latex.el. At the beginning of this file, there is (require 'latex) - I have personal preferences that are not shared, it goes to conf.latex.el - I need the actual latex mode librairy, so I download it from Auctex to my "modes" directory and name the directory "latex". - I register "metadata" which is a list of 3 elements '( module autoload-function automode-extension ), with following meaning : "load module on autoload-function call" and "call autoload-function on file matching automode-extension". Is this case, it will be basicaly '(latex latex-mode ".tex") And that's it. Nothing about latex will be loaded at emacs startup time, except "metadata". Then, when autoload-function is called for the first time, is does the "proper loading of module" that confused you, which is detailled below : 1 - load conf.latex.el (again, this is a per-user optional file) 2 - unless tidyconfig-avoid-local-mode has been set to 't in conf.latex.el, look for a directory in modes directory which name is "latex". If found, add it to load-path. 3 - load mod.latex.el. This module does (require 'latex), which in turn will define real latex-mode. 4 - call latex-mode The file mentionned above can be visited from [2]. So why do I have all this system ? Because, as strange as it can look at first glance, it provides strong consistency over how emacs config is managed as a whole, for me and for my "network". As well as easier portability over systems. I did not invente anything, 99% of the goodness is due to emacs clean design. I just did the last 1% to make it easier to access. I think it might be surprising mainly because it uses some conventions for loading process, while conventional lisp librairy explicitly express their dependencies through load-path settings, (require ...) (load ...) etc. Although I think the later is more robust, so is the right choice in most cases, I think the former is easier to maintain, for me, in the particular case of .emacs configuration. > I have lost you completely here. I'm sorry about that. If you have a web browser and want to give it a try, please go to [1], download a snapshot clicking on "zip" or "gz", extract in any directory, cd to this directory, and enter emacs -q -l tidyconfig.start.el Regards, -- Paul [1] http://emacs.kekerekex.net:8008/tidyconfig-vanilla/summary [2] http://emacs.kekerekex.net:8008/tidyconfig-vanilla/file