-
Notifications
You must be signed in to change notification settings - Fork 170
Description
Dear AUCTeX and straight.el developers,
I am writing to report and seek clarification on a persistent issue
with the cyclic function indirection error related to context-mode
and ConTeXt-mode in AUCTeX.
Issue Description
When using AUCTeX with straight.el package manager, I consistently
encounter the following error during startup:
Debugger entered--Lisp error: (cyclic-function-indirection context-mode)
defalias(context-mode ConTeXt-mode)
eval((defalias 'context-mode #'ConTeXt-mode))
straight--activate-package-autoloads(...)
Environment
- Emacs version: 31.0.50 (development version)
- AUCTeX source: Git repository (https://git.savannah.gnu.org/git/auctex.git)
- Package manager: straight.el
- OS: Ubuntu 22.04.4 LTS
Root Cause
The issue appears to be in the auctex-autoloads.el file,
specifically this line:
(defalias 'context-mode #'ConTeXt-mode)This creates a circular reference when the autoloads are processed, as
ConTeXt-mode itself is defined as an autoload that hasn't been
loaded yet.
Relationship to Previous Bug Reports
I noticed this appears to be related to bug#68998 and bug#69081. While
bug#68998 was closed with a workaround for the upgrade process (using
emacs -Q), the underlying cyclic function indirection issue seems to
persist in daily usage scenarios.
Current Workaround
I am currently using this workaround in my straight.el configuration:
(use-package auctex
:straight (:type git :host nil :repo
"https://git.savannah.gnu.org/git/auctex.git"
:pre-build (("make"))
:post-build (("sed" "-i" "/^(defalias 'context-mode
#'ConTeXt-mode)$/d" "auctex-autoloads.el"))
:files (:defaults "doc/*"))
;; ... rest of configuration
)This removes the problematic defalias line after each build, which
resolves the issue.
Questions
-
Is this a known ongoing issue, or should the cyclic reference
problem have been resolved? -
Would it be appropriate to modify the autoload generation to handle
this defalias more safely, perhaps with a conditional check like:(when (fboundp 'ConTeXt-mode) (defalias 'context-mode #'ConTeXt-mode))
-
Is there a recommended approach for package managers like
straight.el to handle this issue without manual post-build
modifications?
Additional Context
This issue affects not just the initial loading but also functionality
like M-x completion in some configurations, as reported by other
users in the Emacs community.
Thank you for your excellent work on AUCTeX and straight.el. I would be happy to
provide additional debugging information or test potential fixes.
See here for the related discussion.
Best regards,
Zhao