[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Avoid apostrophe being output as non-ASCII quote in Info output
From: |
Patrice Dumas |
Subject: |
Re: Avoid apostrophe being output as non-ASCII quote in Info output |
Date: |
Thu, 23 Feb 2023 08:50:15 +0100 |
On Wed, Feb 22, 2023 at 06:44:03PM +0000, Gavin Smith wrote:
> Link to previous discussion:
>
> > https://lists.gnu.org/archive/html/automake-patches/2022-12/msg00000.html
> > https://lists.gnu.org/archive/html/bug-texinfo/2022-12/msg00076.html
>
> The summary is that words with apostrophes, like "don't", should be
> output in Info with an ASCII apostrophe so it is easy to search for these
> words.
>
> Unfortunately, I cannot think of an unobtrusive way of implementing this
> other than by adding new customization variable(s).
>
> ASCII_PUNCTUATION affects the output of other symbols such as
> @bullet{} and @result{} (everything listed in %extra_unicode_map in
> Texinfo/Convert/Unicode.pm), so setting ASCII_PUNCTUATION to true by
> default may not be good for some users who are used to these non-ASCII
> renderings in Info.
If the point is to be able to search for strings, it would make sense to
have ` ' ``, '', --- and -- and symbols such as @bullet{} both be output
as ASCII when one wants ' to be output as ASCII. This would mean that
ASCII_GLYPH=1 could imply ASCII_PUNCTUATION=1. However, if
ASCII_PUNCTUATION=1 is the default, it may not matter, and avoiding
overlapping is better for simpler implementation and documentation.
> I suggest splitting the function of ASCII_PUNCTUATION so that following
> two things can be configured separately:
>
> * Use of non-ASCII characters for some glyph commands (in
> Texinfo/Convert/Text.pm, in 'brace_no_arg_command')
> * Text processing (in Texinfo/Convert/Plaintext.pm, in _process_text) to
> convert ``, '', --- and -- ligatures.
and ' and ` too (as you did).
> The latter would probably be an improvement for --- and -- too, as
> the two types of dash may appear indistinguishable in a fixed width font:
>
> a — b – c
A -- becomes - with ASCII_PUNCTUATION=1, so it isn't more distinguishable
than the unicode ndash. To make it distinguishable, we should have ---
remains --- and -- remains --.
> Adding a new configuration variable to configure the second point
> would be simple to do.
>
> It would have been better if -c ASCII_PUNCTUATION=1 avoided any of the
> non-ASCII output that was output before; however, with a new variable
> for the second point, the name of ASCII_PUNCTUATION would become more
> misleading as most of what it affected wouldn't be punctuation.
>
> Hence, what I propose is adding a new variable (ASCII_GLYPH or similar)
> for the first point, set to false by default. ASCII_PUNCTUATION would
> only affect the second point, and be set to true by default.
Ok.
> There is a third function of ASCII_PUNCTUATION:
>
> * output for @samp etc. (in Texinfo/Convert/Plaintext.pm)
>
> This can be configured with OPEN_QUOTE_SYMBOL and CLOSE_QUOTE_SYMBOL.
> Unfortunately again, Unicode curly quotes would reappear for the
> output of these for anybody currently using '-c ASCII_PUNCTUATION=1'.
> (Since this variable was only introduced in Texinfo 7.0, it's possible
> it doesn't have many users anyway.)
>
> Double quotes are unaffected by this disucssion although Patrice recently
> added OPEN_DOUBLE_QUOTE_SYMBOL and CLOSE_DOUBLE_QUOTE_SYMBOL symbols.
This looks good to me. The only issue I see is that the original report
that made us add ASCII_PUNCTUATION asked for everything relevant to be
ASCII, including what can be set with *QUOTE_SYMBOL. Now, to get the
same effect one would have to set
ASCII_GLYPH=1 OPEN_QUOTE_SYMBOL=` CLOSE_QUOTE_SYMBOL='
OPEN_DOUBLE_QUOTE_SYMBOL=" CLOSE_DOUBLE_QUOTE_SYMBOL="
Should we add another customization option that does that (and also sets
ASCII_PUNCTUATION=1 for consistency)?
--
Pat