我有以下 LaTeX 代码,其中包含一些我想从 flyspell 中排除的自定义宏和环境。
Some normal text
\begin{customenv}
Please dont flyspell-this
\end{customenv}
again some normal text (please flyspell this) and some \customcode{dont-flyspell-this}.
我知道我需要编写一个函数来传递给 flyspell-mode-predicate,但是我很难让它同时适用于 \customcode 和 \begin{customenv} 和 \end{customenv}。
欢迎任何建议。
更新: 看来我可以设置以下内容:
(setq flyspell-tex-command-regexp
"\\(\\((\\(begin\\|end\\)[ \t]*{\\|\\(cite[a-z*]*\\|label\\|ref\\|eqref\\|usepackage\\|documentclass\\|customcode\\)[ \t]*\\(\\[[^]]*\\]\\)?{[^{}]*\\)\\|\\\\begin{\\(customenv[1-9]*\\)}\\(.\\|\n\\)*\\\\end{\\(customenv[1-9]*\\)}\\)")
这似乎适用于,\customcode{stuff}
但它仍然没有跳过文本customenv