bug-texinfo
[Top][All Lists]
Advanced

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

Re: How do I suppress "helpful" blank lines generated by makeinfo?


From: Alan Mackenzie
Subject: Re: How do I suppress "helpful" blank lines generated by makeinfo?
Date: Thu, 16 Apr 2009 11:44:37 +0000
User-agent: Mutt/1.5.9i

Hi, Karl!

On Wed, Apr 15, 2009 at 04:28:06PM -0500, Karl Berry wrote:
> Hi Alan,

>     I hate being forced to do what somebody else thinks is the right
>     thing to want to do.  :-)

> For better or worse, one of the whole design features of Texinfo from
> the time rms and chassell invented it was to have almost no style
> options.  There is no option for this.

I agree with this feature.  Lots of options make for intimidating
software (hi, Emacs! :-).

>     But in this particular case, this:

> I can agree with you that the list is more readable without the blank
> lines.

>     The Texinfo manual agrees with this, almost (but not quite) stating
>     that omitting a blank line before @item carries over to the Info
>     file.

> Yeah, that's a discrepancy.  I can speculate that the original
> texinfo-format-buffer circa 1986 did not insert the blank lines.  But
> if there was ever a time that makeinfo did not insert the blank lines,
> it was many years ago.

OK.

> The problem is that there are many manuals which sprinkle blank lines
> around essentially at random wrt @item, and expect the right thing to
> happen.  So following the source file's blank lines is not practical.

Shame.  

> I could imagine an option like
> @itemize @bullet squeeze
> or doing it as a separate command,
> @listspacing squeezed

> Not crazy about the syntax in either case, but those are the ideas that
> come to mind.  Semantically, it would explicitly say to omit the blank
> lines (and less space in the TeX output, too).

How about using @itemx?  The _definition_ of @itemx inside a @table seems
to be that it suppresses the blank line after the preceding @item/@itemx.
So that I could write:

    @table @asis
    @item Those codes which have a lisp function or variable as a direct
    equivalent:
    @itemize @asis
    @itemx @samp{*} (check not read-only): @code{barf-if-buffer-readonly}
    @itemx @samp{d} (point): @code{point}
    @itemx @samp{i} (nil): @code{nil}
    @itemx @samp{m} (mark):@code{mark}
    @itemx @samp{n} (number): @code{read-number}
    @itemx @samp{P} (raw prefix): @code{current-prefix-arg} (variable)
    @itemx @samp{r} (region): @code{region-beginning} and @code{region-end}
    @itemx @samp{v} (user option): @code{read-variable}
    @itemx @samp{x} (lisp expression): @code{read-minibuffer}
    @itemx @samp{X} (evaluate lisp expression): @code{eval-minibuffer}
    @itemx @samp{z} (coding system): @code{read-coding-system}
    @end itemize

    @end table

, and get this generated:

    Those codes which have a lisp function or variable as a direct
    equivalent:
              `*' (check not read-only): `barf-if-buffer-readonly'
              `d' (point): `point'
              `i' (nil): `nil'
              `m' (mark):`mark'
              `n' (number): `read-number'
              `P' (raw prefix): `current-prefix-arg' (variable)
              `r' (region): `region-beginning' and `region-end'
              `v' (user option): `read-variable'
              `x' (lisp expression): `read-minibuffer'
              `X' (evaluate lisp expression): `eval-minibuffer'
              `z' (coding system): `read-coding-system'

.  In fact, that is exactly what I did, after applying the following
quick and dirty patch.  (BTW, you've got some gorgeously maintainable
code here :-):


*** insertion.c~        2008-05-22 12:11:34.000000000 +0000
--- insertion.c 2009-04-16 11:07:24.113963632 +0000
***************
*** 2204,2216 ****
  
          case itemize:
          case enumerate:
!           if (itemx_flag)
!             {
!               line_error (_("@itemx not meaningful inside `%s' block"),
!                           insertion_type_pname (current_insertion_type ()));
!             }
!           else
!             {
                if (html)
                  add_html_block_elt ("<li>");
                else if (xml)
--- 2204,2218 ----
  
          case itemize:
          case enumerate:
! /*           if (itemx_flag) */
! /*             { */
! /*               line_error (_("@itemx not meaningful inside `%s' block"), */
! /*                           insertion_type_pname (current_insertion_type 
())); */
! /*             } */
! /*           else */
! /*             { */
!             if (itemx_flag)
!                 close_single_paragraph () ;
                if (html)
                  add_html_block_elt ("<li>");
                else if (xml)
***************
*** 2257,2263 ****
                    line_number--;
                    input_text_offset = original_input_text_offset;
                  }
!             }
            break;
  
          case table:
--- 2259,2265 ----
                    line_number--;
                    input_text_offset = original_input_text_offset;
                  }
! /*             } */
            break;
  
          case table:

> k

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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