[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Avoid spurious space in macro expansion
From: |
Gavin D. Smith |
Subject: |
branch master updated: Avoid spurious space in macro expansion |
Date: |
Sat, 11 Mar 2023 06:04:42 -0500 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 57c136472e Avoid spurious space in macro expansion
57c136472e is described below
commit 57c136472e27f0735cf3d04365bf30d38616980d
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Mar 11 11:04:10 2023 +0000
Avoid spurious space in macro expansion
* doc/texinfo.texi (\defmacro): Define a control sequence with
\string rather than \relax. This avoids an extra space appearing
for an argument substituted into an environment like @example.
* doc/texinfo-tex-test.texi (Bugs, Substitution into @example):
Update now-working test case.
---
ChangeLog | 11 +++++++++++
doc/texinfo-tex-test.texi | 8 +++++---
doc/texinfo.tex | 15 ++++++++-------
3 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 435888c40e..99a3021347 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-03-11 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Avoid spurious space in macro expansion
+
+ * doc/texinfo.texi (\defmacro): Define a control sequence with
+ \string rather than \relax. This avoids an extra space appearing
+ for an argument substituted into an environment like @example.
+
+ * doc/texinfo-tex-test.texi (Bugs, Substitution into @example):
+ Update now-working test case.
+
2023-03-11 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): determine if an
diff --git a/doc/texinfo-tex-test.texi b/doc/texinfo-tex-test.texi
index 2f60bd6330..bc9c962d40 100644
--- a/doc/texinfo-tex-test.texi
+++ b/doc/texinfo-tex-test.texi
@@ -531,9 +531,7 @@ And multiple paragraphs.
Like an argument to @b{@@footnote}.
}
-@section Bugs
-
-Here an extra space appears in the output:
+@section Substitution into @t{@@example}
@macro Twoarg {arg,argtwo}
@example
@@ -543,6 +541,10 @@ Here an extra space appears in the output:
@Twoarg{bbbbb, 22222222222}
+@example
+@result{}bbbbb@result{}
+@end example
+
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index 2f11da59fb..ef83988bdf 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2023-03-04.12}
+\def\texinfoversion{2023-03-11.10}
%
% Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc.
%
@@ -8415,13 +8415,14 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\def\defmacro{%
\let\hash=##% convert placeholders to macro parameter chars
\ifnum\paramno=1
- \def\xeatspaces##1{##1}%
- % This removes the pair of braces around the argument. We don't
- % use \eatspaces, because this can cause ends of lines to be lost
- % when the argument to \eatspaces is read, leading to line-based
- % commands like "@itemize" not being read correctly.
+ \long\def\xeatspaces##1{##1}%
+ % We don't use \xeatspaces for single-argument macros, because we
+ % want to keep ends of lines. This definition removes \xeatspaces
+ % when \macrobody is expanded below.
\else
- \let\xeatspaces\relax % suppress expansion
+ \def\xeatspaces{\string\xeatspaces}%
+ % This expands \xeatspaces as a sequence of character tokens, which
+ % stops \scantokens inserting an extra space after the control sequence.
\fi
\ifcase\paramno
% 0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Avoid spurious space in macro expansion,
Gavin D. Smith <=