I faced problem auctex loading (use-package auctex).
Played with different tags without success.
(straight-override-recipe
'(auctex :type git :repo "git://git.savannah.gnu.org/auctex.git"))
Other ~80 packages still loaded as expected.
You are trying to load the auctex feature with use-package, but no such feature actually exists (just try (require 'auctex)). What you probably want is something like
(use-package tex
:straight auctex
:defer t
:config
(setq TeX-auto-save t)
(setq TeX-parse-self t))
Or if you don't have any configuration that necessitates the use of use-package, just
(straight-use-package 'auctex)
will suffice.
My setup includes tex-site and company-auctex. All worked just fine until last update. Well, not appropriate point with auctex, must be tex-site etc.
Let's test:
emacs -Q
`````
(let ((bootstrap-file (concat user-emacs-directory "straight/repos/straight.el/bootstrap.el"))
(bootstrap-version 3))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(setq use-package-always-demand t
straight-enable-use-package-integration t
straight-use-package-by-default t)
(use-package tex
:straight auctex
:defer t
:config
(setq TeX-auto-save t)
(setq TeX-parse-self t))
(use-package company-auctex)
`````
=>
Debugger entered--Lisp error: (file-error "Cannot open load file" "No such file or directory" "tex-site")
require(tex-site)
eval-buffer(#<buffer *load*-33673> nil "/home/user/.emacs.d/straight/build/auctex/tex.el" nil t) ; Reading at buffer position 1122
load-with-code-conversion("/home/user/.emacs.d/straight/build/auctex/tex.el" "/home/user/.emacs.d/straight/build/auctex/tex.el" nil t)
require(tex)
eval-buffer(#<buffer *load*> nil "/home/user/.emacs.d/straight/build/company-auctex/company-auctex.el" nil t) ; Reading at buffer position 1174
load-with-code-conversion("/home/user/.emacs.d/straight/build/company-auctex/company-auctex.el" "/home/user/.emacs.d/straight/build/company-auctex/company-auctex.el" t t)
require(company-auctex nil t)
(not (require (quote company-auctex) nil t))
(if (not (require (quote company-auctex) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote company-auctex)) :error))
(condition-case err (if (not (require (quote company-auctex) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote company-auctex)) :error)) ((debug error) (funcall use-package--warning1 :catch err)))
(progn (straight-use-package (quote company-auctex)) (defvar use-package--warning1 (function (lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning (quote use-package) msg :error))))) (condition-case err (if (not (require (quote company-auctex) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote company-auctex)) :error)) ((debug error) (funcall use-package--warning1 :catch err))))
eval((progn (straight-use-package (quote company-auctex)) (defvar use-package--warning1 (function (lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning (quote use-package) msg :error))))) (condition-case err (if (not (require (quote company-auctex) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote company-auctex)) :error)) ((debug error) (funcall use-package--warning1 :catch err)))) nil)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
I did some detective work. It looks like @tarsius migrated the EmacsMirror version of AUCTeX from mirroring the version published to the GNU ELPA Git repository (in which someone ran the build script and then checked the build artifacts into version control before merging) to instead mirroring the actual upstream repository. That happened on February 18 in this commit. (This involved rebasing the EmacsMirror repository.)
As a consequence, you now need to build AUCTeX locally in order for tex-site.el to exist. I.e.,
$ ./autogen.sh && ./configure && make
and unfortunately straight.el still does not support doing this automatically, but at least you can do it manually in the cloned Git repository and it doesn't have to be re-done when the package is rebuilt.
This is kind of a big problem because lots of people use AUCTeX. Let's leave this open until AUCTeX works smoothly again.
As a temporary workaround, you can of course fork before the rebase, and just switch straight.el to use that instead.
This is what Radian does, see radian-langs.el and my fork of AUCTeX.
Sooooooooooooooo…
I gave up on a sane solution, and consequently I now maintain a full mirror of GNU ELPA on GitHub. You can tell straight.el to use it by customizing the user option straight-recipes-gnu-elpa-use-mirror. This allows you to use AUCTeX as nature intended.
@raxod502 That seems like a pretty extreme solution. Do you have other reasons for doing this?
The other reasons are human, not technical, in nature. To fix this in a "sane" way he would have to either convince me to mirror the gnu elpa version or upstream to track the generated file. I suspect he senses that the responsible parties do not feel like doing that.
So I think this is a reasonable approach. For an insignificant package it would be overkill, but this is a well established one. From experience maintaining the Emacsmirror, I know that a manual kludge is sometimes the only sane approach when the alternative is to either add a special-case to the code or try to convince upstream, who might have good (or sometimes not so good) reasons to do things the way they have always been done (even when it is the only package out of a few thousand that does it).
In the specific case of AUCTeX, there is a third solution that @tarsius did not mention: adding support for arbitrary build commands as per #72, and then grabbing a recipe for AUCTeX from el-get as per #115. Of course, this introduces a lot of added complexity, which is why #72 hasn't gotten implemented yet.
But the one specific other reason that pushed me over the edge was https://github.com/raxod502/straight.el/issues/293 and my realization that some packages (e.g. jsonrpc) in GNU ELPA were unusable without a full local clone of the Emacs source repository.
At that point, I concluded that mirroring GNU ELPA was the simplest solution, in terms of person-hours. It only took six hours and 250 lines of Python code, after all. Supporting build commands would have taken a lot longer, and even then I would have to also deal with the weird build system of GNU ELPA on the client side, plus cloning and managing the Emacs source repository, and probably other things I didn't think of.
FWIW @tarsius, I think you made the right call in mirroring the official upstream of AUCTeX rather than the hacked ELPA version, so I wouldn't even try to convince you otherwise :)
I am sorry, I have reread the thread several times but cannot find an answer. What is the appropriate way to install AUCTeX using straight and use-package. Should I compile something manually. The AUCTeX distribution pulled by straight has some problems. If you want I can elaborate.
Please do elaborate—but could you open a new issue for it, so we keep different problems in different threads?
I use
(setq straight-recipes-gnu-elpa-use-mirror t)
(straight-use-package 'auctex)
without problem in my personal configuration. (Note that straight-recipes-gnu-elpa-use-mirror must be set _before_ the bootstrap snippet.)
I'm still not getting the .el.in files compiled to .el in my build folder. straight/build/auctex still includes auctex.el.in (and no auctex.el), and tex-site.el.in (and no tex-site.el). So when I try to load, e.g., auctex-latexmk, and it attempts to load tex-site, it fails.
EDIT: Should note that I'm using the mirror, standard bootstrap code, and then
(use-package tex
:straight auctex
:defer t
:config (...usual config...))
Have you forgotten to run M-x straight-normalize-package RET auctex RET (or alternatively update the remotes manually)?
It sounds like you have, because the GNU ELPA mirror does in fact include tex-site.el.
If it still doesn't work, or you have more questions, could you open a new issue for it?
Whoops, wasn't aware of this command! Sorry. (Former Emacs 23 user trying to get used to the brave new world of contemporary Emacs package management.)
You're not the only one confused by the fact that normalization is required. Better documentation and clearer UX is certainly needed, but I just haven't gotten the time to do it yet.
Best of luck :)
When follow your instructions above, I get the error
Could not find package auctex in recipe repositories: (org-elpa melpa gnu-elpa emacsmirror)
The error message indicates that you did not change the value of straight-recipes-gnu-elpa-use-mirror _before_ the bootstrap snippet. Otherwise gnu-elpa would be replaced with gnu-elpa-mirror.
This functionality is documented here, although given the number of questions I receive about it, it's clearly not documented well enough :)
I have
(setq straight-recipes-gnu-elpa-use-mirror t)
directly above my bootstrap snippet. Is there something that could be interfering with this?
Are you sure you are using a revision of straight.el which has support for this feature?
The functionality which controls this is fairly simple:
You may be able to infer what is going wrong by inspecting this code and the value of straight-recipe-repositories (which is modified by calls to straight-use-recipes).
I'm not sure how to check what revision I'm using, but I did notice that the bootstrap snippet in my init.el had (bootstrap-version 4) whereas the snippet on the README now has (bootstrap-version 5). I changed the version and restarted emacs but it doesn't seem to have done anything. Do I need to do something to force a reinstall?
You can check what revision is checked out in the Git repository ~/.emacs.d/straight/repos/straight.el. The filesystem structure is documented here.
The bootstrap snippet version should be completely unrelated to this issue. If you still have trouble, I'm happy to help, but would you mind opening a new thread so as not to clutter this one?
Incidentally, I hope you copied the updated bootstrap snippet from the README in its entirety, rather than just changing the version number. Otherwise it rather defeats the purpose of the version number, which is supposed to tell me exactly which code you used to load straight.el.
For people finding this in 2021 when trying to figure out how to automate installation of AUCTeX Git master, I think straight.el can do this now that it understands the :build bits of el-get recipes! This seems to have worked for me this doesn't work, see my following comment
;; As of Emacs 485622bbd1a you/I need AUCTeX > 13.0.5, or else you
;; get errors when reftex tries to create labels.
;(straight-use-package '(auctex :source el-get)) ;; nope, see following comment
;; See the :load bits of
;; https://github.com/dimitri/el-get/blob/master/recipes/auctex.rcp,
;; which are not supported by straight.el as of this writing. Without
;; these you will get built-in Emacs LaTeX modes, not AUCTeX.
(require 'tex-site)
(require 'preview-latex)
Thanks to everyone working on straight.el!
For people finding this in 2021 when trying to figure out how to automate installation of AUCTeX Git master, I think straight.el can do this now that it understands the
:buildbits of el-get recipes!
This man lies. I thought it was working, until I happened into a macro that AUCTeX should know the arguments for but didn't, because various bits including style/*.el weren't being copied into load-path.
This updated bit at least picks up those missing files:
;; As of Emacs 485622bbd1a you/I need AUCTeX > 13.0.5, or else you
;; get errors when reftex tries to create labels.
;;
;; The el-get recipe won't work for AUCTeX because (I assume) el-get
;; runs Elisp right out of the repo it clones to, which contains
;; support files (ex. styles/*.el) that won't be there if you use that
;; same recipe with straight.el. Hence we make our own recipe.
(straight-use-package '(auctex :source el-get
:files ("*.el" "*.info" "dir"
"doc" "etc" "images" "latex" "style")))
;; See the :load bits of
;; https://github.com/dimitri/el-get/blob/master/recipes/auctex.rcp,
;; which are not supported by straight.el as of this writing. Without
;; these you will get built-in Emacs LaTeX modes, not AUCTeX.
(require 'tex-site)
(require 'preview-latex)
The resulting straight/build/auctex now looks much more like the AUCTeX package you get from ELPA. I have confirmed that AUCTeX's style-specific Elisp files are being loaded in at least a handful of cases.
Sorry for the spam, but I felt it was incumbent upon me to correct my error. If I have further corrections I'll just slap them in my init.el. Feel free to contact me however if you find more problems or have questions of me.
Most helpful comment
You are trying to load the
auctexfeature withuse-package, but no such feature actually exists (just try(require 'auctex)). What you probably want is something likeOr if you don't have any configuration that necessitates the use of
use-package, justwill suffice.