bug-texinfo
[Top][All Lists]
Advanced

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

Re: TRAMP User Manual problems with Texinfo 5.0


From: Patrice Dumas
Subject: Re: TRAMP User Manual problems with Texinfo 5.0
Date: Sat, 23 Feb 2013 00:00:28 +0100
User-agent: Mutt/1.5.20 (2009-12-10)

On Thu, Feb 21, 2013 at 10:38:39PM +0200, Eli Zaretskii wrote:
> 
>   @macro xxx address@hidden
>   @set address@hidden
>   @end macro
> 
>   @macro yyy {one, address@hidden
>   @address@hidden
>   @ifclear address@hidden
>   address@hidden@c
>   @end ifclear
>   @clear address@hidden
>   @end macro
> 
>   @macro trampfn {method, user, host, address@hidden
>   @address@hidden,@address@hidden,@@address@hidden@c
>   @end macro
> 
> The important one is the last one: it needs to produce results like
> this:
> 
>   @address@hidden, daniel%BIZARRE, melancholia, /daniel$$/.emacs}}
> 
>    => `/smb:address@hidden:/daniel$$/.emacs'

In the new implementation, the result not that, because the last newline 
of a user macro invocation is always stripped, and it remains a mystery
why previous makeinfo processed that right as it also stripped the last
newline -- maybe not consistently.

More precisely

@trampfn{, user, host, localname}

leads first to 

@address@hidden,@address@hidden,@@address@hidden@c

The next expansion is

/@address@hidden
@ifclear address@hidden
@address@hidden@c
@end ifclear
@clear address@hidden@yyy{user,@@address@hidden@c

At this point it is already clear that things cannot end well.  The
final expansion is thus not what was intended:

/@set address@hidden@c
@clear address@hidden@yyy{user,@@address@hidden@c

I think that this issue is not the same as the issue of @c being removed
or kept, the issue comes from the newline at the end of @yyy being 
removed.  If the @c are removed from macro definition, the issue 
remains, leading to something along

/@set x
@clear address@hidden,@@address@hidden

Adding an end of line in the @macro definition, however:

@macro byyy {one, two}
@address@hidden
@ifclear address@hidden
address@hidden@c
@end ifclear
@clear address@hidden

@end macro

solves most of the problem, leading to:

/@set address@hidden@c
@clear address@hidden
@set address@hidden@c
address@hidden@@@c
@clear address@hidden
host:address@hidden

The last @c may be problematic if in an @-command, such as in @file,
but then this is an issue covered in the Texinfo mannual, stating

     On the other hand, you wouldn't want the '@c' if the macro was
     sometimes invoked in the middle of a line (the text after the
     invocation would be treated as a comment).


So, there is a fix:
* add a blank line in @yyy definition.
* Remove the trailing @c in @trmpfn definition.

Would that be ok?  In my testings TeX gives also a correct result.



note: there is also still a spurious warning about @end in @file, 
I'll correct that.

-- 
Pat



reply via email to

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