emacsicicles

loading icicle-mode in emacs on startup by default


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.


Solution

  • (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.