bug-texinfo
[Top][All Lists]
Advanced

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

Re: rethinking @def*


From: Gavin Smith
Subject: Re: rethinking @def*
Date: Sun, 14 Aug 2022 21:17:39 +0100

On Wed, Aug 10, 2022 at 10:04:23PM +0200, Patrice Dumas wrote:
> > If people wanted upright @code on a slanted @def line then there would
> > be other ways to achive this, like doing @r{@code{...}}, or using
> > @deftype without a type.
> 
> I agree, in general this should not be needed for the reasons you
> said.  I will give another one, in general it is not a good idea to use
> @code to mark anything on a @def* line, as it adds quotes in Info which
> will be confusing for many programming languages.  That being said, the
> replacement would be @r{@t{...}} which is also a nesting of commands.

We should make @code and maybe @t upright everywhere so it can be
used with @defun and other commands.  This is used in the groff
manual occasionally, in the arguments.  Here is an example:

@DefreqList {bp, [@Var{page}]}
@DefreqItem {bp, @t{+}@Var{page}}
@DefreqItem {bp, @t{-}@Var{page}}

which expands after macros to something like

@deffn Request @t{.bp} [@r{@slanted{page}}]
@deffnx Request @t{.bp} @t{+}@r{@slanted{page}}
@deffnx Request @t{.bp} @t{-}@r{@slanted{page}}

It's the @t{+} and @t{-} which represent literal text in the
arguments.

While in theory @deftypefn could now be used instead for this,
it would be less disruptive to allow @deffn to be used.

I presume @t was used here to stop quotes appearing in Info.
It would seem the simplest solution would be to force uprightness
for both @code and @t.

> For @code, ok, but for @t, I disagree.  @t is just a font change
> command, it should not force anything.  If @t is always upright, also,
> then it is impossible to have a slanted typewriter formatting.  It could
> be left undefined and format specific, but forcing @t to be always
> upright (in @def arguments) seems wrong to me.

Slanted typewriter would still be possible with
@t{@slanted{... rather than @slanted{@t{...  although I doubt this is
something we want to document.  As ever, accumulating font styles does
not work in texinfo.tex and is not something for the user to rely on.







reply via email to

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