[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * doc/texinfo.texi (Other Customization Variables
From: |
Patrice Dumas |
Subject: |
branch master updated: * doc/texinfo.texi (Other Customization Variables), tp/Texinfo/Common.pm (@variable_string_settables), tp/Texinfo/Convert/Plaintext.pm (converter_initialize): add OPEN_DOUBLE_QUOTE_SYMBOL and CLOSE_DOUBLE_QUOTE_SYMBOL to be able to customize double quotes used for @dfn in Info and Plaintext. |
Date: |
Sun, 19 Feb 2023 18:01:23 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 986331f6e7 * doc/texinfo.texi (Other Customization Variables),
tp/Texinfo/Common.pm (@variable_string_settables),
tp/Texinfo/Convert/Plaintext.pm (converter_initialize): add
OPEN_DOUBLE_QUOTE_SYMBOL and CLOSE_DOUBLE_QUOTE_SYMBOL to be able to customize
double quotes used for @dfn in Info and Plaintext.
986331f6e7 is described below
commit 986331f6e7d989c65525fd593ce040e4efb2ab38
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Feb 20 00:01:16 2023 +0100
* doc/texinfo.texi (Other Customization Variables),
tp/Texinfo/Common.pm (@variable_string_settables),
tp/Texinfo/Convert/Plaintext.pm (converter_initialize): add
OPEN_DOUBLE_QUOTE_SYMBOL and CLOSE_DOUBLE_QUOTE_SYMBOL to be able to
customize double quotes used for @dfn in Info and Plaintext.
---
ChangeLog | 8 ++++++++
doc/texinfo.texi | 12 ++++++++++++
tp/Texinfo/Common.pm | 2 ++
tp/Texinfo/Convert/Plaintext.pm | 22 ++++++++++++++++++++--
4 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8cda61ad52..9c26f5022f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-02-19 Patrice Dumas <pertusus@free.fr>
+
+ * doc/texinfo.texi (Other Customization Variables),
+ tp/Texinfo/Common.pm (@variable_string_settables),
+ tp/Texinfo/Convert/Plaintext.pm (converter_initialize): add
+ OPEN_DOUBLE_QUOTE_SYMBOL and CLOSE_DOUBLE_QUOTE_SYMBOL to be able to
+ customize double quotes used for @dfn in Info and Plaintext.
+
2023-02-19 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (@set_flag_index_char_ignore): use only
diff --git a/doc/texinfo.texi b/doc/texinfo.texi
index 98197a8b04..f27c82eec6 100644
--- a/doc/texinfo.texi
+++ b/doc/texinfo.texi
@@ -16818,6 +16818,12 @@ encoding includes that character.
The default for Info is set the same as for @code{OPEN_QUOTE_SYMBOL},
except that the Unicode code is a closing quote (see below).
+@item CLOSE_DOUBLE_QUOTE_SYMBOL
+When a closing double quote is needed, for @samp{@@dfn} in Info, use this
+character. The default for Info is set the same as for
+@code{OPEN_DOUBLE_QUOTE_SYMBOL}, except that the Unicode code is a closing
+double quote (see below).
+
@item COMMAND_LINE_ENCODING
Encoding used to decode command-line arguments. Default is based on the locale
encoding. This may affect file names inserted into output files or error
@@ -17017,6 +17023,12 @@ For Info, the default depends on the enabled document
encoding. If
as an undirected single quote on modern systems. Otherwise, the Info
output uses a Unicode left quote.
+@item OPEN_DOUBLE_QUOTE_SYMBOL
+When an opening double quote is needed, for @samp{@@dfn} output in Info, use
+the specified character. If @option{--disable-encoding} is set or the document
+encoding is not UTF-8, @samp{"} is used. Otherwise, the Info output uses a
+Unicode left double quote.
+
@item OUTPUT_CHARACTERS
If not set, the default, output accented and special characters in HTML, XML
and DocBook using XML entities, and in @LaTeX{} using macros. If set, output
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index f3e2ae99cd..6f98ed3208 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -349,6 +349,7 @@ our @variable_string_settables = (
'COPIABLE_LINKS',
'CHAPTER_HEADER_LEVEL',
'CHECK_HTMLXREF',
+'CLOSE_DOUBLE_QUOTE_SYMBOL',
'CLOSE_QUOTE_SYMBOL',
'COMMAND_LINE_ENCODING',
'COMPLEX_FORMAT_IN_TABLE',
@@ -413,6 +414,7 @@ our @variable_string_settables = (
'NODE_NAME_IN_MENU',
'NO_TOP_NODE_OUTPUT',
'NO_USE_SETFILENAME',
+'OPEN_DOUBLE_QUOTE_SYMBOL',
'OPEN_QUOTE_SYMBOL',
'OUTPUT_CHARACTERS',
'OUTPUT_ENCODING_NAME',
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 0884ab71d8..582b1ea042 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -320,6 +320,8 @@ foreach my $asis_command (@asis_commands) {
my @quoted_commands = ('cite', 'code', 'command', 'env', 'file', 'kbd',
'option', 'samp', 'indicateurl');
+my @double_quoted_commands = ('dfn');
+
# %non_quoted_commands_when_nested have no quote when in code command contexts
my %non_quoted_commands_when_nested;
@@ -448,8 +450,10 @@ sub converter_initialize($)
# Directed single quotes
$self->{'style_map'}->{$quoted_command} = ["\x{2018}", "\x{2019}"];
}
- # Directed double quotes
- $self->{'style_map'}->{'dfn'} = ["\x{201C}", "\x{201D}"];
+ foreach my $quoted_command (@double_quoted_commands) {
+ # Directed double quotes
+ $self->{'style_map'}->{$quoted_command} = ["\x{201C}", "\x{201D}"];
+ }
}
}
if (defined($self->get_conf('OPEN_QUOTE_SYMBOL'))) {
@@ -464,6 +468,20 @@ sub converter_initialize($)
= $self->get_conf('CLOSE_QUOTE_SYMBOL');
}
}
+
+ if (defined($self->get_conf('OPEN_DOUBLE_QUOTE_SYMBOL'))) {
+ foreach my $quoted_command (@double_quoted_commands) {
+ $self->{'style_map'}->{$quoted_command}->[0]
+ = $self->get_conf('OPEN_DOUBLE_QUOTE_SYMBOL');
+ }
+ }
+ if (defined($self->get_conf('CLOSE_DOUBLE_QUOTE_SYMBOL'))) {
+ foreach my $quoted_command (@double_quoted_commands) {
+ $self->{'style_map'}->{$quoted_command}->[1]
+ = $self->get_conf('CLOSE_DOUBLE_QUOTE_SYMBOL');
+ }
+ }
+
if ($self->get_conf('FILLCOLUMN')) {
$self->{'fillcolumn'} = $self->get_conf('FILLCOLUMN');
# else it's already set via the defaults
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * doc/texinfo.texi (Other Customization Variables), tp/Texinfo/Common.pm (@variable_string_settables), tp/Texinfo/Convert/Plaintext.pm (converter_initialize): add OPEN_DOUBLE_QUOTE_SYMBOL and CLOSE_DOUBLE_QUOTE_SYMBOL to be able to customize double quotes used for @dfn in Info and Plaintext.,
Patrice Dumas <=