"Nicolas Richard" <[email protected]> writes:
Hi Nicolas,
> OK, I think I get it, now: modifications in font-latex-syntax-alist
> made by font-latex-add-to-syntax-alist are not propagated to
> font-lock-defaults AND if font-lock-set-defaults is t,
> font-lock-syntax-table won't be updated from font-lock-defaults. I had
> been testing each independently until now :|
>
> TL;DR: The following patch fixes it, but is it TRT ?
>
> diff --git a/font-latex.el b/font-latex.el
> index 6f07766..43d7034 100644
> --- a/font-latex.el
> +++ b/font-latex.el
> @@ -1134,6 +1134,7 @@ triggers Font Lock to recognize the change."
> ;; (cons entry (cadddr font-lock-defaults))))
> ;; Tell font-lock about the update.
> (setq font-lock-set-defaults nil)
> + (font-latex-setup) ; updates font-lock-defaults
> (font-lock-set-defaults))
Yes, I think it is. Also the `font-lock-set-defaults' call can be
omitted then.
> Now that the problem actually works, we may discuss how to fix it ;)
I think, I've already fixed it. I've basically applied your patch but
also removed the `font-lock-set-defaults' call (and the FIXME-commented
code before, which seemed like it was dealing with the same issue as
calling `font-latex-setup' now does).
Additionally, I've changed the default value of `LaTeX-shortvrb-chars'
to nil, because just \usepackage{shortvrb} (directly or indirectly thru
memoir) won't make | a short verbatim char. You need to add
\MakeShortVrb{\|} to your document to get that behavior.
Now also its docstring states that you'd usually set this variable
buffer-locally only and demonstrates how to do it.
Honestly, this is a cheap fix. The sophisticated correction would be to
add a shortvrb type to the auto-parser so that `LaTeX-shortvrb-chars'
always contains exactly those chars for which a \MakeShortVrb{...}
exists in the document. I've not done this because it seems a bit
heavyweight just for the sake of getting |foo| highlighted.
Bye,
Tassilo
_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex