bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] * tp/ext/highlight_syntax.pm: show warning if HIGHLIGHT_S


From: Gavin Smith
Subject: Re: [PATCH v3] * tp/ext/highlight_syntax.pm: show warning if HIGHLIGHT_SYNTAX is defaulting to source-highlight since this behaviour will change in the near future. * tp/tests/other/list-of-tests: set HIGHLIGHT_SYNTAX=source-highlight
Date: Thu, 12 Dec 2024 20:11:12 +0000

On Wed, Dec 11, 2024 at 11:53:10PM +0100, Patrice Dumas wrote:
> On Wed, Dec 11, 2024 at 07:19:33PM +0000, Gavin Smith wrote:
> > On Wed, Nov 27, 2024 at 05:31:15AM +0000, Carlos Maniero wrote:
> > > ---
> > > V3:
> > > - Add missing entry on Changelog
> > > - Update the commit message with the Changelog entry
> > > 
> > > Thanks Patrice for the feedback!
> > > 
> > >  ChangeLog                    | 7 +++++++
> > >  tp/ext/highlight_syntax.pm   | 5 +++++
> > >  tp/tests/other/list-of-tests | 4 ++--
> > >  3 files changed, 14 insertions(+), 2 deletions(-)
> >  
> > 
> > It was suggested that this change be made before the next release.
> > 
> > However, I do not like the idea of saying that HIGHLIGHT_SYNTAX has an
> > invalid value, and yet setting the value still does something (causes
> > "source-highlight") to be used.  It seems more straightforward to make
> > it so that an invalid value is as if the variable were not set at all.
> > 
> > Here is a proposed patch to make this change.  (The changes to the
> > tests made sense.)  I move most of the texinfo_register_* calls
> > into 'highlight_setup' so that the module will not be active if
> > HIGHLIGHT_SYNTAX has an unrecognised value.
> 
> If highlight_setup returns early, %highlighted_languages_list remains
> empty, $commands{$cmdname}->{'results'} is never set, and therefore the
> registered commands formatting functions call the default functions.
> Therefore I see little gain in having texinfo_register_* calls only if
> HIGHLIGHT_SYNTAX has a recognized value, to me is should be treated as
> any other error that leaves %highlighted_languages_list empty.

Thanks, I've amended the patch.  I did not look into the details of
the module and didn't easily understand that it was harmless to enter
the other functions if the initialisation was not done for any of the
highlighting options.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]