calctex
calctex copied to clipboard
Emacs application freezes when I enable calctex while calc buffer is active
I am using macOS, emacs-plus27.1, doom emacs
I can confirm. I testing on Ubuntu withemacs -Q -l path/to/calctex.el
.
Steps to reproduce:
- Open an org-mode file with LaTeX formula environments.
- Start calc and leave the buffer open.
- Put the point inside a formula environment.
- Start CalcTex.
- Switch to the calc buffer.
Emacs will then freeze. I would provide more debugging info but alas, I am not wise in the ways of Emacs.
I suspect what you're seeing is due to this nonsense https://github.com/johnbcoughlin/calctex/blob/7fa2673c64e259e04aef684ccf09ef85570c388b/calctex/calctex.el#L92-L94
This caused me issues for a while, but I finally got around to fixing it. See the last part of https://tecosaur.github.io/emacs-config/config.html#calc, perhaps it may be of some help.
@johnbcoughlin It's great to see that you are spending some more time on this package :grinning:. Feel free to grab what I've done in https://tecosaur.github.io/emacs-config/config.html#calctex,code--2 if it's of some help. You should be able to implement a fix with a very minor modification to the following if you haven't got one already:
;; Fix hardcoded dvichop path (whyyyyyyy)
(let ((vendor-folder (concat (file-truename doom-local-dir)
"straight/"
(format "build-%s" emacs-version)
"/calctex/vendor/")))
(setq calctex-dvichop-sty (concat vendor-folder "texd/dvichop")
calctex-dvichop-bin (concat vendor-folder "texd/dvichop")))
(unless (file-exists-p calctex-dvichop-bin)
(message "CalcTeX: Building dvichop binary")
(let ((default-directory (file-name-directory calctex-dvichop-bin)))
(call-process "make" nil nil nil))