[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Indentation conventions for Info manuals; recognizing code
From: |
Eli Zaretskii |
Subject: |
Re: Indentation conventions for Info manuals; recognizing code |
Date: |
Mon, 08 Mar 2021 15:57:00 +0200 |
> From: Richard Stallman <rms@gnu.org>
> Date: Mon, 08 Mar 2021 00:37:21 -0500
> Cc: emacs-devel@gnu.org
>
> > But other manuals don't seem to use the same indentation. Several
> > (org, eintr, ccmode, efaq(-w32),...) indent code (including Elisp)
> > 5 spaces - which is the same amount that other, non-code text is
> > indented.
>
> Aside from eintr, I don't know anything specific about those manuals.
>
> The eintr manual was written by Bob Chassell; I presume it is still
> generated from Texinfo, right? So I find it puzzling that it produces
> a different format in the Info file.
>
> Why does it do that? Is the source formatted in an unusual way? Does
> it somehow specify different parameters for generating the Info file?
Neither eintr nor any other manual do anything special with @code.
It's an illusion. The actual indentation of a code snippet in the
Info output is determined not only by the immediate Texinfo source,
but also by the surrounding context. The Introduction manual is
written as a book, so @code blocks there are inserted in regular text,
and the indentation of @code there is the original 5-space
indentation. By contrast, most other manuals are written as reference
manuals, and thus are full of @table's, @defun's, etc., and the @code
blocks there are more often than not part of those environments. So
the indentation of @code in those other manuals starts at the
indentation of the innermost environment and not at the left margin.
That's all.