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: Stephen J. Turnbull
Subject: Re: run/load a lisp script before user init file
Date: Wed, 09 Oct 2013 01:01:32 +0900

Jarek Czekalski writes:

 > My attempts to establish a portable way to do that may be annoying.

As far as I know, an automatically recognized autoload cookie *is*
portable source code.  The XEmacs package system automatically
extracts those cookies and loads them when XEmacs starts.  I suppose
that ELPA/package.el-style packages do, too.

If there are two types of sites, those that should have emacspeak
automatically started and those that shouldn't, you can create a
trivial emacspeak-autostart package that contains only a single cookie
like:

;;;###autoload
(progn (load 'emacspeak-init t) (emacspeak-autostart) (fmakunbound 
'emacspeak-autostart))

where emacspeak-init is a library that does nothing but defun the
emacspeak-autostart script (could be part of emacspeak proper, or
could be a separate file in emacspeak-autostart package).  Then
installing that package causes emacspeak to autostart.

(The fmakunbound call is intended to ensure that the autostart
function only gets invoked once, but that may be more paranoid than
necessary.)



reply via email to

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