unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account
@ 2016-11-03 16:11 Clément Pit--Claudel
  2016-11-03 18:05 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Clément Pit--Claudel @ 2016-11-03 16:11 UTC (permalink / raw)
  To: 24868


[-- Attachment #1.1.1: Type: text/plain, Size: 1322 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: test.tex --]
[-- Type: text/x-tex; name="test.tex", Size: 190 bytes --]

\documentclass{article}

\begin{document}
\python=This verb contains an unmatched $=
\end{document}

% Local Variables:
% LaTeX-verbatim-macros-with-delims-local: ("python")
% End:

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account
  2016-11-03 16:11 bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account Clément Pit--Claudel
@ 2016-11-03 18:05 ` Eli Zaretskii
  2016-11-03 18:35   ` Tassilo Horn
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-11-03 18:05 UTC (permalink / raw)
  To: Clément Pit--Claudel; +Cc: 24868

> From: Clément Pit--Claudel <clement.pitclaudel@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account
  2016-11-03 18:05 ` Eli Zaretskii
@ 2016-11-03 18:35   ` Tassilo Horn
  2016-11-03 19:06     ` Clément Pit--Claudel
  2016-11-03 19:09     ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Tassilo Horn @ 2016-11-03 18:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Clément Pit--Claudel, 24868

Eli Zaretskii <eliz@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account
  2016-11-03 18:35   ` Tassilo Horn
@ 2016-11-03 19:06     ` Clément Pit--Claudel
  2016-11-03 19:27       ` Tassilo Horn
  2016-11-03 19:09     ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Clément Pit--Claudel @ 2016-11-03 19:06 UTC (permalink / raw)
  To: Tassilo Horn, Eli Zaretskii; +Cc: 24868


[-- Attachment #1.1: Type: text/plain, Size: 1158 bytes --]

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.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account
  2016-11-03 18:35   ` Tassilo Horn
  2016-11-03 19:06     ` Clément Pit--Claudel
@ 2016-11-03 19:09     ` Eli Zaretskii
  2016-11-03 19:26       ` Clément Pit--Claudel
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-11-03 19:09 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: clement.pitclaudel, 24868

> From: Tassilo Horn <tsdh@gnu.org>
> Cc: Clément Pit--Claudel <clement.pitclaudel@live.com>,
>   24868@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account
  2016-11-03 19:09     ` Eli Zaretskii
@ 2016-11-03 19:26       ` Clément Pit--Claudel
  0 siblings, 0 replies; 7+ messages in thread
From: Clément Pit--Claudel @ 2016-11-03 19:26 UTC (permalink / raw)
  To: 24868


[-- Attachment #1.1: Type: text/plain, Size: 760 bytes --]

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…)))


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account
  2016-11-03 19:06     ` Clément Pit--Claudel
@ 2016-11-03 19:27       ` Tassilo Horn
  0 siblings, 0 replies; 7+ messages in thread
From: Tassilo Horn @ 2016-11-03 19:27 UTC (permalink / raw)
  To: Clément Pit--Claudel, Eli Zaretskii; +Cc: 24868

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@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.
>







^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-03 19:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-03 16:11 bug#24868: 26.0.50; LaTeX-verbatim-macros-with-delims-local isn't taken into account Clément Pit--Claudel
2016-11-03 18:05 ` Eli Zaretskii
2016-11-03 18:35   ` Tassilo Horn
2016-11-03 19:06     ` Clément Pit--Claudel
2016-11-03 19:27       ` Tassilo Horn
2016-11-03 19:09     ` Eli Zaretskii
2016-11-03 19:26       ` Clément Pit--Claudel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).