Reputation: 943
I would like to configure emacs so that the Icy mode is active by default. As suggested in "icicles-doc1.el", I added the following code at the end of my .emacs
file:
(require 'icicles)
(icicle-mode 1)
When I run emacs, I get a *Warning* buffer:
Warning (initialization): An error occurred while loading `c:/Users/USER/AppData/Roaming/.emacs':
File error: Cannot open load file, icicles
To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace.
When I do the debug option, a *Backtrace* buffer says something like:
Debugger entered--Lisp error: (file-error "Cannot open load file" "icicles") require(icicles) eval-buffer(# nil "c:/Users/USER/AppData/Roaming/.emacs" nil t) ; Reading at buffer position 5062 load-with-code-conversion("c:/Users/USER/AppData/Roaming/.emacs" "c:/Users/USER/AppData/Roaming/.emacs" t t) load("~/.emacs" t t) #[0 "\205\262
With or without those two lines in my .emacs
that are causing the problem, icicle-mode seems to work fine when I do a M-x icicle-mode
.
Upvotes: 1
Views: 410
Reputation: 30701
(file-error "Cannot open load file" "icicles")
means that Emacs didn't know where to find library icicles.el[c]
. You need to put the location of the Icicles files in variable load-path
.
E.g, if your Icicles files are in directory /my/icicles/
then you need to do this (e.g., in your init file, ~/.emacs
):
(add-to-list 'load-path "/my/icicles/")
Do that before you do (require 'icicles)
. That way, Emacs will know where to load Icicles from.
Upvotes: 1
Reputation: 74430
Given that the (require 'icicles)
code is failing, but the M-x icy-mode is working, then it seems that someone has already set up your Emacs installation to include icicles via an autoload
command, but didn't update the load-path
to include the directory where icicles.el
resides.
Replace those two lines with:
(icy-mode 1)
(which is the equivalent of M-x icy-mode when icicles has yet to be enabled)
If you want to use a different version of icicles, then you need to add the proper directory to the load path.
Upvotes: 0