0

(message "%S" load-path) and (describe-variable 'load-path) give different results. Several more path like "/Users/updogliu/.emacs.d/elpa/flycheck-20140323.828" appeared in the latter.

How can I make (require 'flycheck) use the "describe" one load-path?

updogliu
  • 6,066
  • 7
  • 37
  • 50
  • if you can reproduce it (different values from `message` and `describe-variable`) with `emacs -Q`, please report it as a bug using `report-emacs-bug`. – sds Mar 25 '14 at 01:25
  • Did you call `package-initialize` in your `init.el`? –  Mar 25 '14 at 09:25
  • You need to understand why describe-variable and message are returning different results. The most likely explanation that I can see is that load-path has a buffer-local value and that you are running describe-variable and message from different buffers. But until you can answer why this is happening (and you have not given enough information), no one can answer your question. – Phil Lord Mar 25 '14 at 10:28

1 Answers1

1

To setup Flycheck properly, you do not need to require Flycheck. Instead, just enable Global Flycheck Mode:

(add-hook 'after-init-hook #'global-flycheck-mode)

This will enable Flycheck for all supported languages.

To make (require 'flycheck) work in your init.el, you need to add (package-initialize) at the very beginning of your init.el.

(package-initialize) sets up Emacs' built-in package system, which includes adding all packages to the load-path. Emacs calls this automatically, but only after your init.el has been processed, hence the use of after-init-hook to enable Flycheck.

If you added a message call to your init.el without calling (package-initialize) first, you'll hence see the standard load-path without any of your packages.

To make your packages available in your init.el right away, you need to call (package-initialize) manually, at the beginning of your init.el.