fix: :load-path throwing error in org-src blocks

Because src blocks don't provide a valid load-file-name or
buffer-file-name, dir! cannot resolve the current file's path.

Fix: #6241
This commit is contained in:
Henrik Lissner 2022-04-06 23:06:32 +02:00
parent 499cf5e626
commit f2f583bfb7
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -373,7 +373,11 @@ This value is cached. If REFRESH-P, then don't use the cached value."
:around #'use-package-normalize-paths :around #'use-package-normalize-paths
;; `use-package-normalize-paths' resolves paths relative to ;; `use-package-normalize-paths' resolves paths relative to
;; `user-emacs-directory', so we change that. ;; `user-emacs-directory', so we change that.
(let ((user-emacs-directory (if (stringp arg) (dir!)))) (let ((user-emacs-directory
(or (and (stringp arg)
(not (file-name-absolute-p arg))
(ignore-errors (dir!)))
user-emacs-directory)))
(funcall fn label arg recursed))) (funcall fn label arg recursed)))
;; Adds two keywords to `use-package' to expand its lazy-loading capabilities: ;; Adds two keywords to `use-package' to expand its lazy-loading capabilities: