1

As far as I understand libraries can define a default.el file that will be loaded on startup. I would like to run librarie's default.el, but not the init file of the user (e.g. in .emacs/init.el). Is it possible somehow to do that? I tried to start emacs with -q but it will not load the libraries at all. I also tried -u fakeuser and it kind of work except that I get an error about a non existant user fakeuser (of course).

2 Answers 2

0

I believe that emacs -q does this (whereas emacs -Q doesn't load either your init file or default.el or site-lisp.el).

See the Emacs manual, node Initial Options.

Oops, I guess that's not correct. Apparently default.el is not loaded with option -q: see node Init File.

But you might give it a try. File default.el doesn't exist, by default. Someone has to create it. If you have edit access to site-lisp.el then you could maybe do what you had intended for default.el there instead.

Or maybe (hopefully) someone else has a proper answer: how to get both site-lisp.el and default.el, but not your init file, loaded at startup.

2
  • Thanks. Oh I thought that each library was free to define its own default.el/site and that emas would charge them all… and in fact there is a single library/file with this name. But I'm using home manager that does create a default file for me (i could certainly put that in site, but then since there is a single site file I guess I will need to edit a file own by root or at least find an elegant way to merge these files and I don't really like that). Acually, can I use maybe -q --eval XX to start the default file? If yet what should I put in XX ?
    – tobiasBora
    Sep 21 at 22:43
  • Hum I tried to run ` emacs -q --eval '(load-library "default.el")'` and it seems to kind of work. I'm just not sure why it does not starts the splash screen in that case while it does if I start it without -q. Is it supposed to be strictly equivalent?
    – tobiasBora
    Sep 21 at 22:53
0

I tried to do

emacs -q --eval '(load-library "default.el")'

and it seems to work… I am not sure though if it is strictly equivalent (maybe the libraries are loaded before default.el instead of after… if you have more information let me know)

2
  • 2
    Was that different to emacs -q -l default ?
    – phils
    Sep 21 at 23:02
  • 1
    @phils Oh this is quicker indeed and seems to work similarly. If you want you can add your own answer that I can accept.
    – tobiasBora
    Sep 21 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.