Reputation: 12120
I am using the Emacs for Mac OSX app, and I need to modify the init.el file, according to the instructions on MELPA. The problem is I can't find any init.el file. Is there one in an obscure location, or is there some other file serving the same purpose? The goal is to make the MELPA packages available for the Emacs 24 package installer.
==== UPDATE ====
To add the MELPA repository, one should add a few lines "before the call to package-initialize in the init.el file", according to the MELPA page. The Emacs for OSX app doesn't seem to have an init.el file, though. Using the command (suggested by @alexander-poslavsky)
C-H (Control-h) v user-init-file RET
I get "~/.emacs", as predicted by @abo-abo. However, that file doesn't exist, so there is no call to package-initialize. Anyway, I created ~/.emacs and added my custom lines to it, as suggested by @abo-abo, and it works. Thanks!
These are currently the only contents of the .emacs file:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
Upvotes: 3
Views: 4229
Reputation: 756
Emacs for OSX uses a 'normal' configuration setup (unlike, for example Aquamacs, or on Windows where the init-file is located somewhere else.
Usually your configuration should be stored in ~/.emacs.d/init.el
(see here for a complete explanation.
Your current config-file should be stored in the variable user-init-file:
use C-h (Control-h) v user-init-file RET
This will show whatever Emacs is using (it might be nil, if it is not using anything).
Hope this helps!
Upvotes: 3
Reputation: 4521
Here is how to create "init.el".
Run terminal with
⌘+spaceterminal
RET
Then input these command in terminal.
ls -a .emacs
ls -a .emacs.d
If terminal says
.emacs: No such file or directory
and
.emacs.d: No such file or directory
you need to create emacs config file like these command.
mkdir .emacs.d
touch .emacs.d/init.el
Now you got "init.el". Customize it as you like.
Upvotes: 0