GNU bug report logs - #71164
14.0.5; Font lock annoyance

Previous Next

Package: auctex;

Reported by: Derek Clegg <derek <at> me.com>

Date: Fri, 24 May 2024 04:45:01 UTC

Severity: normal

Found in version 14.0.5

Fixed in version 14.0.6

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71164 in the body.
You can then email your comments to 71164 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#71164; Package auctex. (Fri, 24 May 2024 04:45:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Derek Clegg <derek <at> me.com>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Fri, 24 May 2024 04:45:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Derek Clegg <derek <at> me.com>
To: bug-auctex <at> gnu.org
Subject: 14.0.5; Font lock annoyance
Date: Thu, 23 May 2024 18:05:53 -0700
If I don't turn on font locking when I use AUCTeX, I'm getting annoying messages almost every keystroke:

  Error during redisplay: (internal--syntax-propertize 7526) signaled (error "Font-lock trying to use keywords before setting them up”)

This appears to be triggered (at least in some cases) by this code in latex.el/LaTeX-verbatim-p:

  (if (eq TeX-install-font-lock 'font-latex-setup)
    ...

This test succeeds (since I haven't changed the value of that variable, I just haven't turned on font locking), and then the error happens.

My workaround is to turn on font locking, but I don't always want to do that. I don't want to change the default value of `TeX-install-font-lock’ since sometimes I *do* want font locking.

Thanks,
Derek Clegg

Emacs  : GNU Emacs 29.2 (build 1, aarch64-apple-darwin23.3.0)
of 2024-02-14
Package: 14.0.5

current state:
==============
(setq
AUCTeX-date "2024-05-19_09:43:32"
window-system nil
LaTeX-version "2e"
TeX-style-path '("~/.emacs.d/auctex"
		  "/Users/derek/.emacs.d/elpa/auctex-14.0.5/style"
		  "/Users/derek/.emacs.d/auctex/auto"
		  "/Users/derek/.emacs.d/auctex/style" "auto" "style")
TeX-auto-save t
TeX-parse-self t
TeX-master t
TeX-command-list '(("Make" "make N=1 %s.pdf" TeX-run-command nil t :help
		     "Run “make”")
		    ("TeX"
		     "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %(output-dir) %t"
		     TeX-run-TeX nil (plain-TeX-mode AmSTeX-mode Texinfo-mode)
		     :help "Run plain TeX")
		    ("LaTeX" "%`%l%(mode)%' %T" TeX-run-TeX nil
		     (LaTeX-mode docTeX-mode) :help "Run LaTeX")
		    ("Makeinfo" "makeinfo %(extraopts) %(o-dir) %t"
		     TeX-run-compile nil (Texinfo-mode) :help
		     "Run Makeinfo with Info output")
		    ("Makeinfo HTML"
		     "makeinfo %(extraopts) %(o-dir) --html %t"
		     TeX-run-compile nil (Texinfo-mode) :help
		     "Run Makeinfo with HTML output")
		    ("AmSTeX"
		     "amstex %(PDFout) %`%(extraopts) %S%(mode)%' %(output-dir) %t"
		     TeX-run-TeX nil (AmSTeX-mode) :help "Run AMSTeX")
		    ("ConTeXt" "%(cntxcom) --once %(extraopts) %(execopts)%t"
		     TeX-run-TeX nil (ConTeXt-mode) :help "Run ConTeXt once")
		    ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t"
		     TeX-run-TeX nil (ConTeXt-mode) :help
		     "Run ConTeXt until completion")
		    ("BibTeX" "bibtex %(O?aux)" TeX-run-BibTeX nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode ConTeXt-mode)
		     :help "Run BibTeX")
		    ("Biber" "biber %(output-dir) %s" TeX-run-Biber nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode)
		     :help "Run Biber")
		    ("Texindex" "texindex %s.??" TeX-run-command nil
		     (Texinfo-mode) :help "Run Texindex")
		    ("Texi2dvi" "%(PDF)texi2dvi %t" TeX-run-command nil
		     (Texinfo-mode) :help "Run Texi2dvi or Texi2pdf")
		    ("View" "%V" TeX-run-discard-or-function t t :help
		     "Run Viewer")
		    ("Print" "%p" TeX-run-command t t :help "Print the file")
		    ("Queue" "%q" TeX-run-background nil t :help
		     "View the printer queue" :visible TeX-queue-command)
		    ("File" "%(o?)dvips %d -o %f " TeX-run-dvips t
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode)
		     :help "Generate PostScript file")
		    ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode)
		     :help "Convert DVI file to PostScript")
		    ("Dvipdfmx" "dvipdfmx -o %(O?pdf) %d" TeX-run-dvipdfmx nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode)
		     :help "Convert DVI file to PDF with dvipdfmx")
		    ("Ps2pdf" "ps2pdf %f %(O?pdf)" TeX-run-ps2pdf nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode)
		     :help "Convert PostScript file to PDF")
		    ("LaTeXMk"
		     "latexmk %(latexmk-out) %(file-line-error) %`%(extraopts) %S%(mode)%' %t"
		     TeX-run-format nil (LaTeX-mode docTeX-mode) :help
		     "Run LaTeXMk")
		    ("Glossaries" "makeglossaries %(d-dir) %s" TeX-run-command
		     nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode)
		     :help "Run makeglossaries to create glossary file")
		    ("Index" "makeindex %(O?idx)" TeX-run-index nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode)
		     :help "Run makeindex to create index file")
		    ("upMendex" "upmendex %(O?idx)" TeX-run-index t
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode)
		     :help "Run upmendex to create index file")
		    ("Xindy" "texindy %s" TeX-run-command nil
		     (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode
		      Texinfo-mode)
		     :help "Run xindy to create index file")
		    ("Check" "lacheck %s" TeX-run-compile nil (LaTeX-mode)
		     :help "Check LaTeX file for correctness")
		    ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (LaTeX-mode)
		     :help "Check LaTeX file for common mistakes")
		    ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil
		     t :help "Spell-check the document")
		    ("Clean" "TeX-clean" TeX-run-function nil t :help
		     "Delete generated intermediate files")
		    ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help
		     "Delete generated intermediate and output files")
		    ("Other" "" TeX-run-command t t :help
		     "Run an arbitrary command")
		    )
)




Information forwarded to bug-auctex <at> gnu.org:
bug#71164; Package auctex. (Fri, 24 May 2024 07:19:01 GMT) Full text and rfc822 format available.

Message #8 received at 71164 <at> debbugs.gnu.org (full text, mbox):

From: Paul Nelson <ultrono <at> gmail.com>
To: Derek Clegg <derek <at> me.com>
Cc: 71164 <at> debbugs.gnu.org
Subject: Re: bug#71164: 14.0.5; Font lock annoyance
Date: Fri, 24 May 2024 09:17:06 +0200
[Message part 1 (text/plain, inline)]
Another workaround might be M-: (font-lock-set-defaults).

It seems that font-lock-set-defaults is typically not called in LaTeX-mode
initialization (see the final comment in font-latex-setup, addressing
bug#65912), but instead via global-font-lock-mode, which I guess you've
disabled.

Paul
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#71164; Package auctex. (Fri, 24 May 2024 13:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 71164 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Derek Clegg <derek <at> me.com>, Paul Nelson <ultrono <at> gmail.com>
Cc: 71164 <at> debbugs.gnu.org
Subject: Re: bug#71164: 14.0.5; Font lock annoyance
Date: Fri, 24 May 2024 22:54:32 +0900
Hi Derek and Paul,

> If I don't turn on font locking when I use AUCTeX, I'm getting
> annoying messages almost every keystroke:

>   Error during redisplay: (internal--syntax-propertize 7526) signaled (error "Font-lock trying to use keywords before setting them up”)

Thanks for your report. I admit AUCTeX isn't good at this point. It
depends on font lock facility to perform syntax propertizing. :-(

>>>>> Paul Nelson <ultrono <at> gmail.com> writes:
> Another workaround might be M-: (font-lock-set-defaults).

It seems it does work while font lock itself is still disabled. I
speculate that the current syntax propertize function only needs that
font lock variables are set up. Then I hope the patch below does the
trick.

Derek, can you try it?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

diff --git a/font-latex.el b/font-latex.el
index ccddd8b1..7a02e3f4 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1313,7 +1313,10 @@ triggers Font Lock to recognize the change."
   (let ((kws ;; (if (derived-mode-p 'docTeX-mode)
              ;;     font-latex-doctex-syntactic-keywords
                font-latex-syntactic-keywords)) ;; )
-    (syntax-propertize-via-font-lock kws)))
+    (let ((func (syntax-propertize-via-font-lock kws)))
+      (lambda (start end)
+        (or font-lock-set-defaults (font-lock-set-defaults))
+        (funcall func start end)))))
 
 ;;;###autoload
 (defun font-latex-setup ()




Information forwarded to bug-auctex <at> gnu.org:
bug#71164; Package auctex. (Mon, 10 Jun 2024 11:59:02 GMT) Full text and rfc822 format available.

Message #14 received at 71164 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Derek Clegg <derek <at> me.com>
Cc: 71164 <at> debbugs.gnu.org, Ikumi Keita <ikumi <at> ikumi.que.jp>,
 Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#71164: 14.0.5; Font lock annoyance
Date: Mon, 10 Jun 2024 12:57:17 +0200
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:

> It seems it does work while font lock itself is still disabled. I
> speculate that the current syntax propertize function only needs that
> font lock variables are set up. Then I hope the patch below does the
> trick.
>
> Derek, can you try it?
>
> Regards,
> Ikumi Keita
> #StandWithUkraine #StopWarInUkraine
> #Gaza #StopMassiveKilling #CeasefireNOW
>
> diff --git a/font-latex.el b/font-latex.el
> index ccddd8b1..7a02e3f4 100644
> --- a/font-latex.el
> +++ b/font-latex.el
> @@ -1313,7 +1313,10 @@ triggers Font Lock to recognize the change."
>    (let ((kws ;; (if (derived-mode-p 'docTeX-mode)
>               ;;     font-latex-doctex-syntactic-keywords
>                 font-latex-syntactic-keywords)) ;; )
> -    (syntax-propertize-via-font-lock kws)))
> +    (let ((func (syntax-propertize-via-font-lock kws)))
> +      (lambda (start end)
> +        (or font-lock-set-defaults (font-lock-set-defaults))
> +        (funcall func start end)))))
>  
>  ;;;###autoload
>  (defun font-latex-setup ()

Derek, can you please report back if the patch above fixes the issue for
you?  TIA.

Best, Arash




Information forwarded to bug-auctex <at> gnu.org:
bug#71164; Package auctex. (Thu, 13 Jun 2024 18:19:02 GMT) Full text and rfc822 format available.

Message #17 received at 71164 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Derek Clegg <derek <at> me.com>
Cc: 71164 <at> debbugs.gnu.org, Ikumi Keita <ikumi <at> ikumi.que.jp>,
 Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#71164: 14.0.5; Font lock annoyance
Date: Thu, 13 Jun 2024 20:18:32 +0200
Arash Esbati <arash <at> gnu.org> writes:

> Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
>
>> It seems it does work while font lock itself is still disabled. I
>> speculate that the current syntax propertize function only needs that
>> font lock variables are set up. Then I hope the patch below does the
>> trick.
>>
>> Derek, can you try it?
>>
>> Regards,
>> Ikumi Keita
>> #StandWithUkraine #StopWarInUkraine
>> #Gaza #StopMassiveKilling #CeasefireNOW
>>
>> diff --git a/font-latex.el b/font-latex.el
>> index ccddd8b1..7a02e3f4 100644
>> --- a/font-latex.el
>> +++ b/font-latex.el
>> @@ -1313,7 +1313,10 @@ triggers Font Lock to recognize the change."
>>    (let ((kws ;; (if (derived-mode-p 'docTeX-mode)
>>               ;;     font-latex-doctex-syntactic-keywords
>>                 font-latex-syntactic-keywords)) ;; )
>> -    (syntax-propertize-via-font-lock kws)))
>> +    (let ((func (syntax-propertize-via-font-lock kws)))
>> +      (lambda (start end)
>> +        (or font-lock-set-defaults (font-lock-set-defaults))
>> +        (funcall func start end)))))
>>  
>>  ;;;###autoload
>>  (defun font-latex-setup ()
>
> Derek, can you please report back if the patch above fixes the issue for
> you?  TIA.

And while we're at it: Do you have a recipe to reproduce this,
preferably starting with "emacs -Q"?  I don't get the errors you
described with:

  • emacs -Q
  • Activate AUCTeX
  • eval (setq TeX-install-font-lock #'ignore)
  • open a .tex file and start typing

Best, Arash




Information forwarded to bug-auctex <at> gnu.org:
bug#71164; Package auctex. (Sat, 29 Jun 2024 21:03:02 GMT) Full text and rfc822 format available.

Message #20 received at 71164 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Derek Clegg <derek <at> me.com>
Cc: 71164 <at> debbugs.gnu.org, Ikumi Keita <ikumi <at> ikumi.que.jp>,
 Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#71164: 14.0.5; Font lock annoyance
Date: Sat, 29 Jun 2024 22:19:07 +0200
Arash Esbati <arash <at> gnu.org> writes:

> Arash Esbati <arash <at> gnu.org> writes:
>
>> Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
>>
>>> It seems it does work while font lock itself is still disabled. I
>>> speculate that the current syntax propertize function only needs that
>>> font lock variables are set up. Then I hope the patch below does the
>>> trick.
>>>
>>> Derek, can you try it?
>>>
>>> Regards,
>>> Ikumi Keita
>>> #StandWithUkraine #StopWarInUkraine
>>> #Gaza #StopMassiveKilling #CeasefireNOW
>>>
>>> diff --git a/font-latex.el b/font-latex.el
>>> index ccddd8b1..7a02e3f4 100644
>>> --- a/font-latex.el
>>> +++ b/font-latex.el
>>> @@ -1313,7 +1313,10 @@ triggers Font Lock to recognize the change."
>>>    (let ((kws ;; (if (derived-mode-p 'docTeX-mode)
>>>               ;;     font-latex-doctex-syntactic-keywords
>>>                 font-latex-syntactic-keywords)) ;; )
>>> -    (syntax-propertize-via-font-lock kws)))
>>> +    (let ((func (syntax-propertize-via-font-lock kws)))
>>> +      (lambda (start end)
>>> +        (or font-lock-set-defaults (font-lock-set-defaults))
>>> +        (funcall func start end)))))
>>>  
>>>  ;;;###autoload
>>>  (defun font-latex-setup ()
>>
>> Derek, can you please report back if the patch above fixes the issue for
>> you?  TIA.
>
> And while we're at it: Do you have a recipe to reproduce this,
> preferably starting with "emacs -Q"?  I don't get the errors you
> described with:
>
>   • emacs -Q
>   • Activate AUCTeX
>   • eval (setq TeX-install-font-lock #'ignore)
>   • open a .tex file and start typing

Ping!  Any updates on this?

@Keita: In case we don't get any response, how do want to proceed?
Install the change or close this report without the change?  My choice
would be the latter since I can't reproduce the issue.

Best, Arash




Information forwarded to bug-auctex <at> gnu.org:
bug#71164; Package auctex. (Sat, 29 Jun 2024 21:31:02 GMT) Full text and rfc822 format available.

Message #23 received at 71164 <at> debbugs.gnu.org (full text, mbox):

From: Paul Nelson <ultrono <at> gmail.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: Derek Clegg <derek <at> me.com>, 71164 <at> debbugs.gnu.org,
 Ikumi Keita <ikumi <at> ikumi.que.jp>
Subject: Re: bug#71164: 14.0.5; Font lock annoyance
Date: Sat, 29 Jun 2024 23:28:44 +0200
I was able to reproduce the issue.  The patch fixes it on my end, and
I suspect in general.




Information forwarded to bug-auctex <at> gnu.org:
bug#71164; Package auctex. (Sun, 30 Jun 2024 01:50:02 GMT) Full text and rfc822 format available.

Message #26 received at 71164 <at> debbugs.gnu.org (full text, mbox):

From: Derek Clegg <derek <at> me.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: 71164 <at> debbugs.gnu.org, Ikumi Keita <ikumi <at> ikumi.que.jp>,
 Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#71164: 14.0.5; Font lock annoyance
Date: Sat, 29 Jun 2024 18:49:02 -0700
Thanks for the email. This has fixed the original problem, so I think it’s good to go.

Best,
Derek

> On Jun 29, 2024, at 1:19 PM, Arash Esbati <arash <at> gnu.org> wrote:
> 
> Arash Esbati <arash <at> gnu.org> writes:
> 
>> Arash Esbati <arash <at> gnu.org> writes:
>> 
>>> Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
>>> 
>>>> It seems it does work while font lock itself is still disabled. I
>>>> speculate that the current syntax propertize function only needs that
>>>> font lock variables are set up. Then I hope the patch below does the
>>>> trick.
>>>> 
>>>> Derek, can you try it?
>>>> 
>>>> Regards,
>>>> Ikumi Keita
>>>> #StandWithUkraine #StopWarInUkraine
>>>> #Gaza #StopMassiveKilling #CeasefireNOW
>>>> 
>>>> diff --git a/font-latex.el b/font-latex.el
>>>> index ccddd8b1..7a02e3f4 100644
>>>> --- a/font-latex.el
>>>> +++ b/font-latex.el
>>>> @@ -1313,7 +1313,10 @@ triggers Font Lock to recognize the change."
>>>>   (let ((kws ;; (if (derived-mode-p 'docTeX-mode)
>>>>              ;;     font-latex-doctex-syntactic-keywords
>>>>                font-latex-syntactic-keywords)) ;; )
>>>> -    (syntax-propertize-via-font-lock kws)))
>>>> +    (let ((func (syntax-propertize-via-font-lock kws)))
>>>> +      (lambda (start end)
>>>> +        (or font-lock-set-defaults (font-lock-set-defaults))
>>>> +        (funcall func start end)))))
>>>> 
>>>> ;;;###autoload
>>>> (defun font-latex-setup ()
>>> 
>>> Derek, can you please report back if the patch above fixes the issue for
>>> you?  TIA.
>> 
>> And while we're at it: Do you have a recipe to reproduce this,
>> preferably starting with "emacs -Q"?  I don't get the errors you
>> described with:
>> 
>>  • emacs -Q
>>  • Activate AUCTeX
>>  • eval (setq TeX-install-font-lock #'ignore)
>>  • open a .tex file and start typing
> 
> Ping!  Any updates on this?
> 
> @Keita: In case we don't get any response, how do want to proceed?
> Install the change or close this report without the change?  My choice
> would be the latter since I can't reproduce the issue.
> 
> Best, Arash





Information forwarded to bug-auctex <at> gnu.org:
bug#71164; Package auctex. (Sun, 30 Jun 2024 04:39:02 GMT) Full text and rfc822 format available.

Message #29 received at 71164 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Derek Clegg <derek <at> me.com>
Cc: 71164 <at> debbugs.gnu.org, Arash Esbati <arash <at> gnu.org>,
 Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#71164: 14.0.5; Font lock annoyance
Date: Sun, 30 Jun 2024 13:38:00 +0900
Hi Derek and all,

>>>>> Derek Clegg <derek <at> me.com> writes:
> Thanks for the email. This has fixed the original problem, so I think
> it’s good to go.

Thank you. I'll install the fix soon.

>> On Jun 29, 2024, at 1:19 PM, Arash Esbati <arash <at> gnu.org> wrote:
>>> And while we're at it: Do you have a recipe to reproduce this,
>>> preferably starting with "emacs -Q"?

Actually, I couldn't recall how I reproduced the issue for a while🥴. At
last I succeeded in reproducing again😆.
1. emacs -Q
2. M-x global-font-lock-mode RET
3. M-x load-file RET /usr/local/share/emacs/site-lisp/auctex.el RET
4. Open circ.tex
5. C-c C-m verb RET somewhere appropriate.
Then I have
Error during redisplay: (internal--syntax-propertize 2) signaled (error "Font-lock trying to use keywords before setting them up")

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




bug marked as fixed in version 14.0.6, send any further explanations to 71164 <at> debbugs.gnu.org and Derek Clegg <derek <at> me.com> Request was from Arash Esbati <arash <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 05 Jul 2024 07:40:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 02 Aug 2024 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 223 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.