unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "paul r" <paul.r.ml@gmail.com>
To: rms@gnu.org
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Feature Request : autoload-form
Date: Mon, 31 Mar 2008 19:36:53 +0200	[thread overview]
Message-ID: <e30f0f320803311036p3df4627fwb823b00b646dd6fa@mail.gmail.com> (raw)
In-Reply-To: <E1JgMoP-00024x-7G@fencepost.gnu.org>

2008/3/31, Richard Stallman <rms@gnu.org>:

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




  reply	other threads:[~2008-03-31 17:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 20:05 Feature Request : autoload-form paul r
2008-03-29  4:20 ` Stefan Monnier
2008-03-29  9:49   ` paul r
2008-03-29 19:40     ` Stefan Monnier
2008-03-30  5:49   ` Richard Stallman
2008-03-30 11:24     ` paul r
2008-03-30 15:03       ` Stefan Monnier
2008-03-30 22:28         ` paul r
2008-03-31  7:58           ` Levin Du
2008-03-30 19:55       ` Richard Stallman
2008-03-30 21:35       ` Mike Mattie
2008-03-31 16:24       ` Richard Stallman
2008-03-31 17:36         ` paul r [this message]
2008-03-31 21:31         ` Mike Mattie
2008-04-02  2:53           ` Richard Stallman
2008-04-02 12:44             ` paul r
2008-04-02 17:34               ` Richard Stallman
2008-04-02 19:06                 ` paul r
2008-04-02 21:07                   ` Don Armstrong
2008-04-03  4:30                     ` Stephen J. Turnbull
2008-04-03  5:01                       ` Don Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e30f0f320803311036p3df4627fwb823b00b646dd6fa@mail.gmail.com \
    --to=paul.r.ml@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).