Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bbn!jr@bbn.com From: jr@bbn.com (John Robinson) Newsgroups: comp.emacs Subject: Re: runtime hook Message-ID: <40104@bbn.COM> Date: 17 May 89 21:31:21 GMT References: <8905171912.AA06544@dsys.icst.nbs.gov> Sender: news@bbn.COM Reply-To: jr@bbn.com (John Robinson) Organization: BBN Systems and Technologies Corporation, Cambridge MA Lines: 38 In-reply-to: rbj@dsys.icst.nbs.GOV (Root Boy Jim) In article <8905171912.AA06544@dsys.icst.nbs.gov>, rbj@dsys (Root Boy Jim) writes: >? From: odi!benson@uunet.uu.net (Benson Margulies) > >? Is there a hook (18.53-wise) that can be set in site-init.el to cause a function >? to run when emacs is started up? > >Yes. It's called `load'. I don't think this gets at what Benson is asking. site-init.el can cause packages to be put into shareable pure lisp space, and can initialize some lisp variables, but it can't leave something around to be run when emacs is started. The file $EMACS/lisp/default.el, if it exists, is loaded at startup for any user without a .emacs file. This may help. Another way to get this effect is to have the installed `emacs' program (/usr/local/bin/emacs or whatever) be a shellscript that does soemthing like: exec /usr/local/emacs/src/xemacs -f special-startup-function $* I do a similar thing (actually, with a csh alias) to get an elc command (emacs-lisp compiler) so as to avoid burdening my persistent emacs with the byte-compiler library. To modify how emacs starts up, look at the code in lisp/startup.el. It's pretty obvious what's going on there. You can probably modify it to look for a (say) default-entry-function symbol and call that at more or less the same place where .emacs or default.el is loaded. I suppose allow .emacs to override it through another config variable or by setting it to nil. -- /jr jr@bbn.com or bbn!jr C'mon big money!