Replies: 1 comment 3 replies
-
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello. I'm configuring my Emacs to use nvarner/typst-lsp, an LSP for a (relatively new) markup typesetting language Typst. and I wish to disable the lsp's "compile on save" feature, that is, whenever I save a *.typ file, I do not want typst-lsp to compile it into a PDF document with the same name in that same directory. According to this, I need to change the setting
exportPdf
tonever
. However I can't find a way to make this setting work in Emacs after hours of attempt. below is what I did:Since Typst is not a supported language by lsp-mode, nor did typst-lsp mention in its readme the install steps for Emacs, I referred to Adding support for languages page, and come up with the following setup:
(in which
typst-ts-mode
is already properly configured)And, If i understood the document correct, I need to use
lsp-defcustom
. Feeding thepackage.json
file from inside the vsix VScode extension file intolsp-generate-settings
, with the second argument being'lsp-typst-lsp
, I got this elisp code:among other five similar
lsp-defcustom
expressions. I appended them to my emacs init file, then added(setq lsp-typst-lsp-export-pdf "never")
.The LSP did work -- completions, error checks, ... all works with my exisiting configuration. But the
exportPdf
=never
setting is not in effect. I still see pdf generated after saving .typ files. In contrast in VS Code or VSCodium, using the extension also provided by nvarner/typst-lsp, I can easily find the setting in the GUI, choose "never", and see the desired effect.What's even stranger, when I tried to
M-x
customize-variable
RET
lsp-typst-lsp-export-pdf
, nothing appears in the eazy customization interface, under the three buttons. Meanwhile an error message appears:widget-choice-match: Symbol’s function definition is void: nil
Where am I doing wrong? Can someone tell me the right way to set these options?
Many thanks🙏🙏 in advance.
Extra information
Emacs version:
GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8)
(vanilla, no doom or other configuration layer)
lsp-mode version: 20240116.1748, installed from melpa
typst-lsp --version
:Version: 0.12.1, commit 1928d88ff8bc3e178ad098146bec252751383a48 (Typst version 0.10.0)
typst-ts-mode (I believe this is not relevant) is meow_king/typst-ts-mode on sourcehut, latest commit, setup as such:
typst --version
:typst 0.10.0 (70ca0d25)
Beta Was this translation helpful? Give feedback.
All reactions