auctex on guix

Table of Contents

File mode specification error: (error Autoloading file ~/emacs/.emacs.d/straight/build/auctex/tex.elc failed to define function tex)

Based on attempts I made to copy solutions from other examples in issues on the github repo1, I had this (which seems to have worked fine in older versions of straight)

(use-package tex
  :straight `(auctex :local-repo ,(tsa/wrap-guix-profile "auctex-13.1.3")) ;; this just says to use the version I downloaded from guix, since it did all the system config
  :mode "\\.tex\\'") 

However, this produced the following error whenever I attempted to visit a tex file:

File mode specification error: (error Autoloading file ~/emacs/.emacs.d/straight/build/auctex/tex.elc failed to define function tex) [3 times]

The error is telling the truth – it does fail to define that function. But what I couldn’t gather was WHY it wanted that function.

I spent a lot of time trying to get the answer, always leading me back to issues on the straight repo, but nothing worked. Finally I had an idea and had this working solution:

(use-package tex-mode ;;; just add -mode

Everything else the same. There is, after all, an emacs function called tex-mode. This did the trick, and I learned something about how straight use-package works now.

Footnotes

1 This self-answer I hope to be of use to others with a similar issue: https://github.com/radian-software/straight.el/issues/977

Tory Anderson avatar
Tory Anderson
Web App Engineer, Digital Humanist, Researcher, Computer Psychologist