auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test for fontification


From: Ikumi Keita
Subject: Re: Test for fontification
Date: Wed, 31 Mar 2021 19:35:04 +0900

Hi Arash,

>>>>> Arash Esbati <arash@gnu.org> writes:
> What do others think, do we need such a general test?

It would be good to have tests considering that syntax propertization
affects syntax-aware functions.

> And if yes, which cases should be included?

How about adding these?
- verbatim environment
- equation environment
- \(\), \[\] pairs
- \emph{...}
- font specification such as \textbf{...} \mathrm{...} {\bfseries ...} 
{\ttfamily ...}

> +      (LaTeX-mode)
> +      (insert "\
> +\\documentclass{article}
> +\\begin{document}
> +Inline verbatim test: \\verb|x|
> +Inline math test: $x$
> +Marginpar test: \\marginpar{x}
> +\\end{document}
> +
> +%%% Local Variables:
> +%%% mode: latex
> +%%% TeX-master: t
> +%%% End:\n")

I think that `(LaTeX-mode)' should come after insertion of buffer
contents because otherwise Local Variables section isn't analysed and
would be confusing when debugging after other local variables are added.

> +      ;; Test for inline verb:
> +      (search-forward-regexp "\\\\verb|")

It would be enough to use `search-forward' since we know the literal
contents.

> +      (should (memq 'font-lock-constant-face
> +                    (get-text-property (match-end 0) 'face)))

Maybe `font-latex-faces-present-p' makes the code a bit simpler.

Regards,
Ikumi Keita



reply via email to

[Prev in Thread] Current Thread [Next in Thread]