Hello,

Tassilo Horn <[email protected]> writes:
> Hm, when I find this file
>
> --8<---------------cut here---------------start------------->8---
> \documentclass{memoir}
> \begin{document}
> This is |foo| and this is |bar|.
> \end{document}
> --8<---------------cut here---------------end--------------->8---
>
> neither foo or bar are fontified, although the | is in the syntax alist:

I blame 'past me' for not giving a full recipe.

OTOH adding \usepackage{shortvrb} to your example doesn't fontify either.

In fact, doing:
emacs -q -l auctex ~/tmp/test.tex --eval '(message "%s\n%s" 
font-latex-syntax-alist font-lock-defaults)'
shows that font-latex-syntax-alist has |, but font-lock-defaults doesn't
have it.
Adding --eval '(font-latex-setup)'
will update font-lock-defaults
but doing C-u C-x = on one of the vertical bars will show that the
syntax is still 'symbol'
Modifying the syntax by hand :
(modify-syntax-entry ?| "|")
will indeed modify the syntax, but still no fontification.

*mumble*

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))
 
 ;;;###autoload

Now that the problem actually works, we may discuss how to fix it ;)

-- 
Nicolas.


_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to