jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.42k stars 260 forks source link

`:load-path` value has to be either a string or a function #1010

Closed z99h closed 1 year ago

z99h commented 2 years ago

:load-path with a string value works as expected.

However, with a normal expression it causes Lisp error: (void-variable expand-file-name):

(use-package my-package :load-path (expand-file-name "config/my-package" (file-name-directory load-file-name))

While wrapping the same expression in lambda works:

(use-package my-package :load-path (lambda () (expand-file-name "config/my-package" (file-name-directory load-file-name))))

use-package version: 0be480ea77655304a4e6aa9d38d9d9a251b2bd32 Emacs version: 29.0.50

skangas commented 1 year ago

I think this is behaving as documented, and I'm not sure how to separate :load-path (foo bar), where the variables are foo and bar, and the case where you are calling the function foo with bar as an argument. So I think wrapping it in a lambda is the best we can do here, and I'm closing this issue.