0

I work on a machine with single sign-on, which I also share with my co-workers, so would like to compile emacs to lookup for a custom startup file instead of the defaults, e.g. .emacs, or .emacs.el or ~/.emacs.d/init.el; as few of the others use the stock emacs package available on the Linux distribution.

I am aware of the fact that I can provide a custom init file on the command line, like so,

$ emacs -q -l /path/to/my/startup.el

But wouldn't prefer to use this as a terminal(pty) needs to opened to type in the command.

Could not get an option in ./configure --help which helps in this case. So, Googled to find out if this is possible and learned that the startup file differs for various distributions of emacs, such as, XEmacs (.xemacs or ~/.xemacs/init.el) and Aquamacs (~/.emacs or ~/Library/Preferences/Aquamacs Emacs/Preferences.el). Also, on emacs wiki i found that the variable 'user-init-file' let's you decide on init file name/location.

So, it seems, this can be configured. I looked up for the variable 'user-init-file' in emacs repository to figure out how but couldn't. Need help in figuring this out.

  • 1
    I don't know what OS you are using, but how about make an alias, like `alias emacs-user1="emacs -q -l /path/to/my/startup.el"` – ysakamoto Feb 25 '14 at 22:36
  • The best option will be to set the startup file as a command line parameter, but you are wrong in saying that you need to use the command line for this. If you are on linux, most desktops provide an easy way to create custom shortcut icons that will launch a shell command. If you are on OSX use automator to create an App that runs the given command. If you are on Windows, you can create a shortcut to emacs and set the command line options from the shortcuts properties window. – Jordon Biondo Feb 25 '14 at 22:44
  • @JordonBiondo, you are right. Linux/Window/Mac OS support desktop shortcuts/apps to be created. But I could not find where to change the default value in the source code. – user3353207 Feb 25 '14 at 23:01
  • look at the function command-line in lisp/startup.el – Jordon Biondo Feb 25 '14 at 23:10
  • @phils thanks for the tip. I was able to come up with a solution for my situation. Thanks again to all who chipped in. Though I am still checking out the option to change the default look up file. – user3353207 Feb 25 '14 at 23:55

0 Answers0