GNU bug report logs - #24868
26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account

Previous Next

Package: auctex;

Reported by: Clément Pit--Claudel <clement.pitclaudel <at> live.com>

Date: Thu, 3 Nov 2016 16:13:02 UTC

Severity: normal

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 24868 in the body.
You can then email your comments to 24868 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-gnu-emacs <at> gnu.org:
bug#24868; Package emacs. (Thu, 03 Nov 2016 16:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Clément Pit--Claudel <clement.pitclaudel <at> live.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 03 Nov 2016 16:13:02 GMT) Full text and rfc822 format available.

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

From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into
 account
Date: Thu, 3 Nov 2016 12:11:49 -0400
[Message part 1 (text/plain, inline)]
Starting from emacs -Q with (add-to-list 'auto-mode-alist '("\\.tex$" . LaTeX-mode)), opening the attached file produces incorrect highlighting.  This is due to LaTeX-verbatim-macros-with-delims-local not being applied properly.

Currently, the workarounds are:
* To not set LaTeX-verbatim-macros-with-delims-local locally (instead, put it in .emacs)
* To add \usepackage{polyglossia} to top of file (??! apparently polyglossia.el somehow refreshes the fontification?)
* Use an "eval:" prop line to refresh fontification:
  % Local Variables:
  % LaTeX-verbatim-macros-with-delims-local: ("fiatverb" "facadeverb" "sqlverb" "cverb")
  % eval: (progn (font-latex-set-syntactic-keywords) (font-latex-setup) (setq font-lock-set-defaults nil) (font-lock-set-defaults))
  % End:

None of these are very pleasant, unfortunately.  Can we add a hook to hack-local-variables that refreshes fontification appropriately?

(also: can we give LaTeX-verbatim-macros-with-delims-local a simple #'safe predicate?)

Thanks!
Clément.

In GNU Emacs 26.0.50.14 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2016-10-29 built on clem-w50-mint
Repository revision: fae796fe2695b419aa9277d243633bae400a147a
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:	Linux Mint 18 Sarah
[test.tex (text/x-tex, attachment)]
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24868; Package emacs. (Thu, 03 Nov 2016 18:06:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
Cc: 24868 <at> debbugs.gnu.org
Subject: Re: bug#24868: 26.0.50;
 LaTeX-verbatim-macros-with-delims-local isn't taken into account
Date: Thu, 03 Nov 2016 20:05:26 +0200
> From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
> Date: Thu, 3 Nov 2016 12:11:49 -0400
> 
> Starting from emacs -Q with (add-to-list 'auto-mode-alist '("\\.tex$" . LaTeX-mode)), opening the attached file produces incorrect highlighting.  This is due to LaTeX-verbatim-macros-with-delims-local not being applied properly.

Maybe I'm blind, but I seem to be unable to reproduce this.  Can you
tell which highlighting is incorrect, i.e. what should happen and what
does happen?

Also, in what version of Emacs did this work?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24868; Package emacs. (Thu, 03 Nov 2016 18:36:02 GMT) Full text and rfc822 format available.

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

From: Tassilo Horn <tsdh <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Clément Pit--Claudel <clement.pitclaudel <at> live.com>,
 24868 <at> debbugs.gnu.org
Subject: Re: bug#24868: 26.0.50;
 LaTeX-verbatim-macros-with-delims-local isn't taken into account
Date: Thu, 03 Nov 2016 19:35:36 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Starting from emacs -Q with (add-to-list 'auto-mode-alist '("\\.tex$"
>> . LaTeX-mode)), opening the attached file produces incorrect
>> highlighting.  This is due to LaTeX-verbatim-macros-with-delims-local
>> not being applied properly.
>
> Maybe I'm blind, but I seem to be unable to reproduce this.  Can you
> tell which highlighting is incorrect, i.e. what should happen and what
> does happen?
>
> Also, in what version of Emacs did this work?

I guess Clement is actually reporting an AUCTeX bug and accidentally
used `report-emacs-bug' instead of `TeX-submit-bug-report'.

And Clément is right.  With the current AUCTeX version modifying
`LaTeX-verbatim-macros-with-delims-local' and friends as a file-local or
directory-local variable doesn't refresh fontification.  Until now,
these variables have been meant mostly for style file authors, and when
a style is loaded, fontification will be recomputed.  But Clément's
use-case is valid, of course.

So Eli,

(1) can we move that bug to the auctex debbugs category?

(2) there's no hook-like thing that would be run whenever some specific
    variable is modified due to file-local or directory-local variables,
    no?  So I guess the right way to make Clément's use-case work was to
    provide functions for modifying those variables that can be run from
    an eval: local variables block and then refresh the fontification if
    needed, right?

Bye,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24868; Package emacs. (Thu, 03 Nov 2016 19:07:02 GMT) Full text and rfc822 format available.

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

From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
To: Tassilo Horn <tsdh <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 24868 <at> debbugs.gnu.org
Subject: Re: bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't
 taken into account
Date: Thu, 3 Nov 2016 15:06:30 -0400
[Message part 1 (text/plain, inline)]
On 2016-11-03 14:35, Tassilo Horn wrote:
> I guess Clement is actually reporting an AUCTeX bug and accidentally
> used `report-emacs-bug' instead of `TeX-submit-bug-report'.

Spot on :) Sorry for the mistake!

> (2) there's no hook-like thing that would be run whenever some specific
>     variable is modified due to file-local or directory-local variables,
>     no?  

There is one :)

    hack-local-variables-hook is a variable defined in ‘files.el’.
    Its value is nil

      This variable may be risky if used as a file-local variable.

    Documentation:
    Normal hook run after processing a file’s local variables specs.
    Major modes can use this to examine user-specified local variables
    in order to initialize other data structure based on them.

> So I guess the right way to make Clément's use-case work was to
> provide functions for modifying those variables that can be run from
> an eval: local variables block and then refresh the fontification if
> needed, right?

I think installing a hack-local-variable hook would be the way to go :)

Cheers and thanks for the quick answer!
Clément.

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24868; Package emacs. (Thu, 03 Nov 2016 19:10:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: clement.pitclaudel <at> live.com, 24868 <at> debbugs.gnu.org
Subject: Re: bug#24868: 26.0.50;
 LaTeX-verbatim-macros-with-delims-local isn't taken into account
Date: Thu, 03 Nov 2016 21:09:50 +0200
> From: Tassilo Horn <tsdh <at> gnu.org>
> Cc: Clément Pit--Claudel <clement.pitclaudel <at> live.com>,
>   24868 <at> debbugs.gnu.org
> Date: Thu, 03 Nov 2016 19:35:36 +0100
> 
> (1) can we move that bug to the auctex debbugs category?

I think this is a simple matter of adding the "package" attribute to
the bug report?

> (2) there's no hook-like thing that would be run whenever some specific
>     variable is modified due to file-local or directory-local variables,
>     no?  So I guess the right way to make Clément's use-case work was to
>     provide functions for modifying those variables that can be run from
>     an eval: local variables block and then refresh the fontification if
>     needed, right?

Probably.  Unless someone will come up with a more clever idea.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24868; Package emacs. (Thu, 03 Nov 2016 19:27:01 GMT) Full text and rfc822 format available.

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

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't
 taken into account
Date: Thu, 3 Nov 2016 15:26:19 -0400
[Message part 1 (text/plain, inline)]
On 2016-11-03 15:09, Eli Zaretskii wrote:
>> > (2) there's no hook-like thing that would be run whenever some specific
>> >     variable is modified due to file-local or directory-local variables,
>> >     no?  So I guess the right way to make Clément's use-case work was to
>> >     provide functions for modifying those variables that can be run from
>> >     an eval: local variables block and then refresh the fontification if
>> >     needed, right?
> Probably.  Unless someone will come up with a more clever idea.

Hmm. Wouldn't something like the following work?

(add-hook 'hack-local-variables-hook
          (lambda () 
             (when (…check relevant variable for a change…)
               (…refresh fontification…)))

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24868; Package emacs. (Thu, 03 Nov 2016 19:28:02 GMT) Full text and rfc822 format available.

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

From: Tassilo Horn <tsdh <at> gnu.org>
To: Clément Pit--Claudel <clement.pitclaudel <at> live.com>,
 Eli Zaretskii <eliz <at> gnu.org>
Cc: 24868 <at> debbugs.gnu.org
Subject: Re: bug#24868: 26.0.50;
 LaTeX-verbatim-macros-with-delims-local isn't taken into account
Date: Thu, 03 Nov 2016 20:27:51 +0100
Hi again,

Thanks for your responses. I'll take care of this issue at the weekend.

Thanks,
Tassilo


Am 3. November 2016 20:06:51 schrieb Clément Pit--Claudel 
<clement.pitclaudel <at> live.com>:

> On 2016-11-03 14:35, Tassilo Horn wrote:
>> I guess Clement is actually reporting an AUCTeX bug and accidentally
>> used `report-emacs-bug' instead of `TeX-submit-bug-report'.
>
> Spot on :) Sorry for the mistake!
>
>> (2) there's no hook-like thing that would be run whenever some specific
>>     variable is modified due to file-local or directory-local variables,
>>     no?
>
> There is one :)
>
>     hack-local-variables-hook is a variable defined in ‘files.el’.
>     Its value is nil
>
>       This variable may be risky if used as a file-local variable.
>
>     Documentation:
>     Normal hook run after processing a file’s local variables specs.
>     Major modes can use this to examine user-specified local variables
>     in order to initialize other data structure based on them.
>
>> So I guess the right way to make Clément's use-case work was to
>> provide functions for modifying those variables that can be run from
>> an eval: local variables block and then refresh the fontification if
>> needed, right?
>
> I think installing a hack-local-variable hook would be the way to go :)
>
> Cheers and thanks for the quick answer!
> Clément.
>






bug reassigned from package 'emacs' to 'auctex'. Request was from Tassilo Horn <tsdh <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 04 Nov 2016 15:23:02 GMT) Full text and rfc822 format available.

bug No longer marked as found in versions 26.0.50. Request was from Tassilo Horn <tsdh <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 04 Nov 2016 15:23:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-auctex <at> gnu.org:
bug#24868; Package auctex. (Fri, 04 Nov 2016 18:55:02 GMT) Full text and rfc822 format available.

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

From: Tassilo Horn <tsdh <at> gnu.org>
To: Clément Pit--Claudel <clement.pit <at> gmail.com>
Cc: 24868 <at> debbugs.gnu.org
Subject: Re: bug#24868: 26.0.50;
 LaTeX-verbatim-macros-with-delims-local isn't taken into account
Date: Fri, 04 Nov 2016 19:54:25 +0100
[Message part 1 (text/plain, inline)]
Clément Pit--Claudel <clement.pit <at> gmail.com> writes:

> On 2016-11-03 15:09, Eli Zaretskii wrote:
>>> > (2) there's no hook-like thing that would be run whenever some specific
>>> >     variable is modified due to file-local or directory-local variables,
>>> >     no?  So I guess the right way to make Clément's use-case work was to
>>> >     provide functions for modifying those variables that can be run from
>>> >     an eval: local variables block and then refresh the fontification if
>>> >     needed, right?
>> Probably.  Unless someone will come up with a more clever idea.
>
> Hmm. Wouldn't something like the following work?
>
> (add-hook 'hack-local-variables-hook
>           (lambda () 
>              (when (…check relevant variable for a change…)
>                (…refresh fontification…)))

Yeah, that did the trick.  I've just pushed a fix like that and also
declared the LaTeX-verbatim-*-local variables as safe-local-variables in
case their value is a list of strings.  I briefly tested that it works
as expected with both a file-local variables section and a
.dir-locals.el file.

Could you give it a try and report back so that I can close the bug
then?

Bye,
Tassilo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#24868; Package auctex. (Mon, 04 Mar 2024 22:46:01 GMT) Full text and rfc822 format available.

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

From: Arash Esbati <arash <at> gnu.org>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: 24868 <at> debbugs.gnu.org,
 Clément Pit--Claudel <clement.pit <at> gmail.com>
Subject: Re: bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local
 isn't taken into account
Date: Mon, 04 Mar 2024 23:44:40 +0100
Tassilo Horn <tsdh <at> gnu.org> writes:

> Clément Pit--Claudel <clement.pit <at> gmail.com> writes:
>
>> On 2016-11-03 15:09, Eli Zaretskii wrote:
>>>> > (2) there's no hook-like thing that would be run whenever some specific
>>>> >     variable is modified due to file-local or directory-local variables,
>>>> >     no?  So I guess the right way to make Clément's use-case work was to
>>>> >     provide functions for modifying those variables that can be run from
>>>> >     an eval: local variables block and then refresh the fontification if
>>>> >     needed, right?
>>> Probably.  Unless someone will come up with a more clever idea.
>>
>> Hmm. Wouldn't something like the following work?
>>
>> (add-hook 'hack-local-variables-hook
>>           (lambda () 
>>              (when (…check relevant variable for a change…)
>>                (…refresh fontification…)))
>
> Yeah, that did the trick.  I've just pushed a fix like that and also
> declared the LaTeX-verbatim-*-local variables as safe-local-variables in
> case their value is a list of strings.  I briefly tested that it works
> as expected with both a file-local variables section and a
> .dir-locals.el file.
>
> Could you give it a try and report back so that I can close the bug
> then?

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I presume that this issue resolved, therefore I'm closing this report.

Best, Arash




bug closed, send any further explanations to 24868 <at> debbugs.gnu.org and Clément Pit--Claudel <clement.pitclaudel <at> live.com> Request was from Arash Esbati <arash <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 04 Mar 2024 22:46: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. (Tue, 02 Apr 2024 11:24:26 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 38 days ago.

Previous Next


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