[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Mon, 7 Aug 2023 05:59:37 -0400 (EDT) |
branch: master
commit dee54f882368994477d5350f7d6a7c1255352881
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Aug 7 10:59:27 2023 +0100
* tp/Texinfo/Common.pm (@variable_string_settables):
Change AUTO_MENU_DESCRIPTION_FILLCOLUMN to
AUTO_MENU_MAX_WIDTH and AUTO_MENU_DESCRIPTION_INDENT_LENGTH to
AUTO_MENU_ALIGN_COLUMN.
---
NEWS | 5 ++---
doc/texinfo.texi | 17 +++++++++--------
tp/Texinfo/Common.pm | 4 ++--
tp/Texinfo/Convert/Plaintext.pm | 23 ++++++++++++-----------
tp/t/10menu.t | 4 ++--
5 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/NEWS b/NEWS
index 09b71edccd..a2560cb7f1 100644
--- a/NEWS
+++ b/NEWS
@@ -58,9 +58,8 @@ See the manual for detailed information.
. new ASCII_GLYPH variable for using ASCII renditions for glyph
commands (like @bullet).
. ASCII_PUNCTUATION still includes the effect of these new variables.
- . new variables AUTO_MENU_DESCRIPTION_FILLCOLUMN and
- AUTO_MENU_DESCRIPTION_INDENT_LENGTH control the format of
- descriptions in generated menus
+ . new variables AUTO_MENU_DESCRIPTION_ALIGN_COLUMN and AUTO_MENU_MAX_WIDTH
+ control the format of descriptions in generated menus
. XML output:
. menu leading text and menu separator in elements instead of attributes.
diff --git a/doc/texinfo.texi b/doc/texinfo.texi
index 5633587bcb..1255a8b252 100644
--- a/doc/texinfo.texi
+++ b/doc/texinfo.texi
@@ -16121,17 +16121,18 @@ output. Implies both @code{ASCII_DASHES_AND_QUOTES}
and @code{ASCII_GLYPH}
and additionally affects the output of commands such as @code{@@samp} which
output quotation marks.
-@item AUTO_MENU_DESCRIPTION_FILLCOLUMN
-Maximum number of columns in a line for @code{@@nodedescription} or
-@code{@@nodedescriptionblock} menu entry description formatting in Info.
+@item AUTO_MENU_DESCRIPTION_ALIGN_COLUMN
+For Info output, column at which to start a menu entry description
+provided by @code{@@nodedescription} or @code{@@nodedescriptionblock}.
+Undefined by default, in which case 45% of the fill column value is used
+(@pxref{Invoking @command{texi2any}}).
+
+@item AUTO_MENU_MAX_WIDTH
+Maximum number of columns in a menu entry line in Info when adding a
+description from @code{@@nodedescription} or @code{@@nodedescriptionblock}.
Undefined by default, in which case 10% more than the fill column value
is used (@pxref{Invoking @command{texi2any}}).
-@item AUTO_MENU_DESCRIPTION_INDENT_LENGTH
-Indentation for @code{@@nodedescription} or @code{@@nodedescriptionblock}
-menu entry description formatting in Info. Undefined by default, in which case
-44% of the fill column value is used (@pxref{Invoking @command{texi2any}}).
-
@item CHECK_MISSING_MENU_ENTRY
When a @code{@@menu} block occurs in a node, check if there is a menu
entry for all subordinate nodes in the document sectioning structure. On
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index c8e0c6a278..d258227036 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -343,8 +343,8 @@ our @variable_string_settables = (
'ASCII_DASHES_AND_QUOTES',
'ASCII_GLYPH',
'ASCII_PUNCTUATION',
-'AUTO_MENU_DESCRIPTION_FILLCOLUMN',
-'AUTO_MENU_DESCRIPTION_INDENT_LENGTH',
+'AUTO_MENU_DESCRIPTION_ALIGN_COLUMN',
+'AUTO_MENU_MAX_WIDTH',
'AVOID_MENU_REDUNDANCY',
'BEFORE_SHORT_TOC_LINES',
'BEFORE_TOC_LINES',
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index dbd57ec35e..9986711ead 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -1724,9 +1724,9 @@ sub _get_form_feeds($)
return $form_feeds;
}
-#my $description_indent_length = 31;
-# computed as 31/72
-my $description_indent_length_factor = 0.44;
+#my $description_align_column = 32;
+# computed as 32/72, rounded up
+my $description_align_column_factor = 0.45;
sub _convert($$);
@@ -3478,15 +3478,16 @@ sub _convert($$)
and $self->{'labels'}
->{$menu_entry_node->{'extra'}->{'normalized'}}->{'extra'}
->{'node_description'})
{
- my $description_indent_length;
- if
(defined($self->get_conf('AUTO_MENU_DESCRIPTION_INDENT_LENGTH'))) {
- $description_indent_length
- = $self->get_conf('AUTO_MENU_DESCRIPTION_INDENT_LENGTH');
+ my $description_align_column;
+ if
(defined($self->get_conf('AUTO_MENU_DESCRIPTION_ALIGN_COLUMN'))) {
+ $description_align_column
+ = $self->get_conf('AUTO_MENU_DESCRIPTION_ALIGN_COLUMN');
} else {
- $description_indent_length
+ $description_align_column
= int($self->{'text_element_context'}->[-1]->{'max'}
- * $description_indent_length_factor);
+ * $description_align_column_factor);
}
+ my $description_indent_length = $description_align_column - 1;
my $description_element = $self->{'labels'}
->{$menu_entry_node->{'extra'}->{'normalized'}}->{'extra'}
@@ -3521,9 +3522,9 @@ sub _convert($$)
'counter' => $text_count
};
- if (defined($self->get_conf('AUTO_MENU_DESCRIPTION_FILLCOLUMN'))) {
+ if (defined($self->get_conf('AUTO_MENU_MAX_WIDTH'))) {
$text_element_context->{'max'}
- = $self->get_conf('AUTO_MENU_DESCRIPTION_FILLCOLUMN');
+ = $self->get_conf('AUTO_MENU_MAX_WIDTH');
} else {
# e.g. 72 -> 79
$text_element_context->{'max'}
diff --git a/tp/t/10menu.t b/tp/t/10menu.t
index 0cd3785b2f..8cc2f0ca81 100644
--- a/tp/t/10menu.t
+++ b/tp/t/10menu.t
@@ -668,8 +668,8 @@ where the max column could be. @w{in w}.
@listoffloats tfloat
-',{},{'AUTO_MENU_DESCRIPTION_INDENT_LENGTH' => 15,
- 'AUTO_MENU_DESCRIPTION_FILLCOLUMN' => 90}],
+',{},{'AUTO_MENU_DESCRIPTION_ALIGN_COLUMN' => 16,
+ 'AUTO_MENU_MAX_WIDTH' => 90}],
);
my @test_invalid = (