emacscollective / auto-compile

Automatically compile Emacs Lisp libraries
GNU General Public License v3.0
172 stars 16 forks source link

Path to compat needed #28

Closed pedz closed 1 year ago

pedz commented 1 year ago

For me to require auto-compile in my early-init.el file, I had to provide the path to compat. I did this:

(dolist (dir '( "lib/packed" "lib/auto-compile" "lib/compat" ))
  (add-to-list 'load-path (expand-file-name dir user-emacs-directory)))

so that more paths could be added if needed. I just tested it again and got the same results: Emacs can't find compat:

File is missing: Cannot open load file, No such file or directory, compat  

tarsius commented 1 year ago

I am guessing that an outdated early-init.elc exists. Or maybe you are installing in a temporary location so user-emacs-directory isn't correct.

This is how I do it:

(setq load-prefer-newer t)

(let ((dir (file-name-directory (or load-file-name buffer-file-name))))
  (add-to-list 'load-path (expand-file-name "lib/compat" dir))
  (add-to-list 'load-path (expand-file-name "lib/packed" dir))
  (add-to-list 'load-path (expand-file-name "lib/auto-compile" dir)))
(require 'auto-compile)
(auto-compile-on-load-mode)
(auto-compile-on-save-mode)
tarsius commented 1 year ago

Yes, I need to update the documentation.

pedz commented 1 year ago

I wondered if my original post was confusing. What I pasted is working. The point was simply that the path to compat needs to be included and the doc say just the paths for packed and auto-compile.

tarsius commented 1 year ago

I'll have to decide whether to update the documentation or drop the dependency again. This might involve merging parts of packed into auto-compile, so it could take a while.

tarsius commented 1 year ago

I've decided to drop the dependency (packed is gone too).