Open yilkalargaw opened 1 year ago
I was able to get it to work via the following:
2022-12-29 00:53:38
gnu/linux
prerelease (HEAD -> develop, origin/develop) 05caec1 2022-12-22
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.17.6) of 2022-12-18
This is because straight-use-package-mode internally uses with-eval-after-load
to set up its integration. Adding (require use-package-core)
prior to straight's bootstrap snippet should work.
Thank you @progfolio adding (require 'use-package-core)
before bootstrap and (use-package doct :straight t)
worked for me. It might be worth adding it to the documentation if it is a must do when using builtin use-package.
Sorry I jumped the gun. It just cloned melpa and non-gnu-elpa and reverted back to the previous errors.
Please try evaluating the test case from above in your *scratch* buffer:
https://github.com/radian-software/straight.el/issues/1035#issuecomment-1367081185
When it finishes running the *straight-bug-report-process* buffer should pop up. Please copy the entire buffer contents of that buffer here.
It said that lexial binding was required so I run (setq lexical-binding t)
before evaluating it.
2022-12-29 11:36:59
gnu/linux
prerelease (HEAD -> develop, origin/develop) e407ed5 2022-12-26
GNU Emacs 30.0.50 (build 7, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.17.6) of 2022-12-22
The test appears to have passed. What does your init file currently look like?
Currently I am running the config I mentioned above because I'm trying to start from scratch. I'll try it another machine and report if the issue persists.
Was there any definitive solution for this issue? Running straight.el on the latest Emacs 29 version only works consistently when using my non-bytecompiled init.el file.
When loading with my byte-compiled init.elc, the native compilation yields the same error messages as mentioned above (e.g., "Error (use-package): Failed to parse package paradox: use-package: Unrecognized keyword: :straight"). The next time I restart Emacs, the initialization process encounters the following error: "Warning (initialization): An error occurred while loading โ/Users/bram/.emacs.d/eln-cache/29.0.60-4bf8ba72/init-563b6df7-97eefad5.elnโ:".
I tried with and without the suggested workaround ("(require 'use-package-core)").
@bramadams: See https://www.gnu.org/software/emacs/manual/html_node/elisp/Compiling-Macros.html
You'd likely have to wrap some forms in eval-and-compile
or eval-when-compile
to get that working.
Honestly, I wouldn't recommend compiling your init file. It's more trouble than it's worth. That's the official consensus, too:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html
Thanks a lot, @progfolio, this suggestion got it to work!
My full initialization code to make byte/native compilation work with straight.el on Emacs 29 (23/03/2023 snapshot):
(eval-and-compile
(defvar bootstrap-version)
(setq straight-repository-branch "develop") ; TEMPORARY issue with straight, see https://jeffkreeftmeijer.com/emacs-straight-use-package/
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;; Install use-package
(straight-use-package '(use-package :type built-in))
(require 'bind-key)
(setq straight-use-package-by-default t))
I can confirm @bramadams 's solution works. But as @progfolio points out, it's better not to byte compile the init file.
Having read the Emacs manual link @progfolio mentioned, I got a feeling I should try out disabling byte-compilation of my init file, thanks for the encouragement @lebensterben :-)
Yeah, you can definitely byte-compile the init-file, but it takes special handling and custom code to make it work right. Otherwise you'll get all manner of problems. https://github.com/radian-software/radian is one reference configuration for taking care of this with straight.el
.
What's wrong
I recently compiled Emacs from source. It has built in use-package. When trying to run my setup it fails with the error about unrecognized keyword :straight
Directions to reproduce