bug-texinfo
[Top][All Lists]
Advanced

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

Re: HTML bugs revisited


From: Eli Zaretskii
Subject: Re: HTML bugs revisited
Date: Tue, 29 Jan 2002 12:08:18 +0200 (IST)

On Mon, 28 Jan 2002, Werner LEMBERG wrote:

>   if (!looking_at ("@def"))
>     {
>       add_word ("</table>\n");
>       add_html_elt ("<table width=\"95%\" align=\"center\">");
>       add_word ("\n<tr><td>\n");
>     }
> 
> 
> The looking at address@hidden' fails.

Yes.  It fails because your Defesc macro expands into this:

  @deffn ...
  @esindex ...

So the next line after @deffn is @esindex, not something which starts
with a @def.

> It seems to me that macros aren't expanded before this operation.

Makeinfo only expands the macros as it reads the input.  looking_at
looks at as yet unread input, so it doesn't see what macro expansion
would yield.

However, your problem has very little to do with macro expansion,
since the stumbling block is @esindex, not the unexpanded @Defescx
macro.

There's no good solution to this, unfortunately.  The code fragment
above is IMHO a terrible kludge, so it's a small wonder it breaks
under slightly unusual circumstances.  One work-around I can suggest
is to define a dummy macro:

  @macro defdummy
  @end macro

And then modify your @Def... macros like this:


  @macro Defesc{name, delimI, arg, delimII}
  @deffn Escape @address@hidden@t{\delimII\}
  @esindex \name\
  @end macro

  @macro Defescx{name, delimI, arg, delimII}
  @deffnx Escape @address@hidden@t{\delimII\}
  @esindex \name\
  @end macro

  @macro Defescm{name, delimI, arg, delimII}
  @deffn Escape @address@hidden@t{\delimII\}
  @defdummy
  @esindex \name\
  @end macro

  @macro Defescmx{name, delimI, arg, delimII}
  @deffnx Escape @address@hidden@t{\delimII\}
  @defdummy
  @esindex \name\
  @end macro

The 2 additional macros @Defescm and @Defscmx are to be used instead
of @Defesc and @Defscx, respectively, like this:

  @Defescm
  @Defescmx
  @Defescmx
  @Defescx

That is, use @Defescm instead of @Defesc as the first @Def in a group,
use @Defescmx instead of @Defescx in all but the last @Def's, and use
@Defescx as the last.  You should still use @Defesc when there's only
one @def item.

> Additionally the string `\n[ident]' is represented as
> 
>   <b><tt>\n[</tt></b><i><var>ident</var><tt>]</tt>
>   </i>
> 
> (embedded in a <td>...</td> construction).  This is not correct.  It
> should rather be
> 
>   <b><tt>\n[</tt></b><i><var>ident</var><b><tt>]</tt></b>

I don't understand why do you think so.  @deffn formats only the
function's _name_ in bold, the rest are the function's arguments, so
they are formatted in slanted face, like TeX does with @var (since
arguments in the @def... commands have the implicit @var markup).

> To use TeX parlance, the category code of the closing bracket in the
> @rbrack macro isn't `active', and the HTML parsing routine should take
> care of this.

Sorry, I don't follow: the closing bracket in this case has no
significance for makeinfo, it is just a character you added through
your @Defesc macro.  The @def... commands don't recognize and don't
produce any brackets.  Am I missing something?

> BTW, ordinary `[' and `]' in a @defmac are printed upright in a DVI
> file, while they are slanted in the HTML output (which is incorrect).

Please show the Texinfo fragment you were using.  If you are adding
the @t markup via macro, like you did in @Defesc, it's possible that
mixing slanted and typewriter faces has different effects in different
browsers.  But that's a hunch, since I didn't see your use of @defmac.



reply via email to

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