1

CEDET prevents me from doing M-x load-file init.el with the error:

progn: CEDET Version 2.0 already loaded.

How do I modify my CEDET load line to load conditionally? The current line looks like:

(load-file "~/.emacs.d/cedet/cedet-devel-load.el")
artagnon
  • 2,237
  • 1
  • 15
  • 17

1 Answers1

3

Simplest method

Assuming you're not worried about it not being available because the file is missing/in error

(ignore-errors
  (load-file "~/.emacs.d/cedet/cedet-devel-load.el"))

This will bypass the error and allow you to continue loading.

Require instead of load

Looking at cedet-devel-load.el on https://github.com/emacsmirror/cedet/blob/master/cedet-devel-load.el the last line is (provide 'cedet-devel-load).

This means you can replace your load line with:

;; If you haven't already added it to load path above
(add-to-list 'load-path "~/.emacs.d/cedet")
(require 'cedet-devel-load)

This will use the library and ensure you do not have to worry about it being loaded more than the initial time.

Jonathan Leech-Pepin
  • 4,307
  • 1
  • 19
  • 32