I am new to emacs. I'm trying to use cask to manage emacs packages.
This is my ~/.emacs.d/init.el
:
(require 'cask "~/etsi/cask/cask.el")
(cask-initialize "~/etsi")
(require 'evil)
(evil-mode 1)
~/etsi/Cask
file:
(source "melpa" "http://melpa.milkbox.net/packages/")
(source "gnu" "http://elpa.gnu.org/packages/")
(depends-on "evil")
However, it does not seem to work. For example, whenever I open a file, there seems to be no evil mode. (Yes I add cask
binary to $PATH
and ran cask install
.)
Looking at other people's publicly available dotfiles, I see they use Cask too and do the same or similar things, so I'm not sure what I did wrong.
I also tried the following for ~/.emacs.d/init.el
:
(require 'package)
(require 'cask "~/etsi/cask/cask.el")
(package-initialize)
(cask-initialize "~/etsi")
(require 'evil)
(evil-mode 1)
which also does not work.
Why?
Because I am new to emacs, perhaps I'm doing it wrong, and explaining what exactly I'm trying to achieve might bring forward a more straightforward solution.
Instead of manually M-x package-install RET <package-name> RET
for each and every package, I want to simply put a list of them somewhere (in a text file), and have something automatically install them all (and take care of initalization). This is because I want to replicate my emacs setup across multiple machines, and obviously doing M-x package-install RET <package-name> RET
for each package on each machine is not desirable.
I thought cask was the correct tool for this, since you can have a Cask
file to list your packages. And just use the cask install
command to install them. When I ran cask install
, it did download and "install" (to .cask
directory) evil and its dependencies. But emacs does not seem to load it?
I also tried (add-to-list 'load-path (cask-load-path ((cask-initialize "~/etsi"))))
instead of (cask-initialize "~/etsi")
, but that did not work either.
Is el-get the right tool for the job instead? Reading the introductory documentation, it wasn't clear that it was, hence why I chose clask, because their documentation specifically said "If you are using Cask for your Emacs configuration [...]".
Edit: Maybe I'm checking for evil mode wrong? Is there a reliable way to check for the existence of a package, i.e. whether or not it has been loaded? I'm checking for evil by just pressing j, or searching for evil mode help with C-h evil
.
~/.emacs
and~/.emacs.d/init.el
(or I guess any other startup file) are mutually exclusive. I had one line .emacs file. I thought there was a load order or something. i.e. init.el loads before .emacs. For anyone reading in the future, solved by removing~/.emacs
file (or transferring the contents of that too init.el and then deleting).