emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: run/load a lisp script before user init file


From: Jarek Czekalski
Subject: Re: run/load a lisp script before user init file
Date: Tue, 08 Oct 2013 08:46:36 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0


W dniu 2013-10-08 08:27, Stephen J. Turnbull pisze:
It doesn't actually solve any problems, and makes some of them harder
to solve (eg, uninstall).

I thought it makes uninstall easier. Just erase the file you added. I mean that during install I add the file site-lisp/emacspeak/site-start.el.

   It's ugly (why should the site-start
library be treated differently from any other?[1])

I don't think of site-start as of a library. Rather as a start-up script. Let's go back to Debian Emacs. Why did they invent site-start.d directory? To circumvent the lack of the feature I describe. So let's call site-start a script and the problems gone :)

   It's not general
(I suspect that at the point where site-start is run, the load-path is
very short.)

No. On Debian it already contains dozens of paths.

What's wrong with the obvious solution?  Like this:

1. Install your script on the load-path in some application-specific file.
2. Compile it.
3. Find site-start.  If it doesn't exist yet, create an empty one.

Easy to say: "Find site-start". How? Let's have a difficult example: Debian. It places site-start.el file in /etc/emacs. It is a template, empty file with comments. When I inspect the load-path at site-start moment, the beginning of load-path is as follows: /etc/emacs23 /etc/emacs. So which place should I choose for *my* site-start? And what if the next dev chooses /etc/emacs23, because he would somehow know how to locate this better place.

4. Check for the presence of "(require 'my-script-file)" in
    site-start.  If it's there, you're done.  (This can be done
    accurately by using the Lisp reader to read site-start.)
5. If it's not there, append it to site-start.


The solution you suggest is not bad. I'll fallback to it :)

Jarek




reply via email to

[Prev in Thread] Current Thread [Next in Thread]