bug-texinfo
[Top][All Lists]
Advanced

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

Re: Paragraph filling in texi2any


From: Gavin Smith
Subject: Re: Paragraph filling in texi2any
Date: Sat, 1 Sep 2018 08:57:54 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, Sep 01, 2018 at 03:23:46AM +0300, Bad Blue Bull wrote:
> <div> </div><div> </div><div>27.08.2018, 19:27, "Gavin Smith" 
> &lt;address@hidden&gt;:</div><blockquote type="cite"><div><div><div>On Mon, 
> 27 Aug 2018, 15:51 Bad Blue Bull, &lt;<a 
> href="mailto:address@hidden";>address@hidden</a>&gt; wrote:</div><blockquote 
> style="margin:0 0 0 0.8ex;border-left:1px #ccc 
> solid;padding-left:1ex;"><div>Hi, can someone point to me where paragraph 
> filling for texi2any is implemented?</div></blockquote></div><div> 
> </div><div>In tp/Texinfo/Convert/ParagraphNonXS.pm and 
> tp/Texinfo/XS/Paragraph in the Texinfo sources.</div><div> 
> </div></div></blockquote><div> </div><div>Thanks, but still can't find 
> it:</div><div>I've found one place in the add_text subroutine, $result is a 
> line broken but only small part of all lines matches 
> condition:</div><blockquote><div> </div></blockquote><div>      #print STDERR 
> "delete END_SENTENCE($paragraph-&gt;{'end_sentence'}): spaces\n"</div><div>   
>    #  if (defined($paragraph-&gt;{'end_sentence'}) and 
> $paragraph-&gt;{'DEBUG'});</div><div>      #delete 
> $paragraph-&gt;{'end_sentence'};</div><div>      if 
> ($paragraph-&gt;{'counter'} + length($paragraph-&gt;{'space'})</div><div>     
>                  &gt; $paragraph-&gt;{'max'}) {</div><div>      $result .= 
> _cut_line($paragraph);</div><div>      print $result;</div><div>     
> ...</div><div>    </div><blockquote><div> </div></blockquote><div>I want to 
> fix filling for infos so it will stretch lines up to fill-column not just 
> break them.  Stretching should not be applied for the lines between paired 
> tags (like @example and @end example) and also for the last line of a 
> paragraph, any assistance would be very much appreciated because this looks 
> like realy hard task (yet I don't know Perl and I'm hardly falling in love 
> with it tbh).  Would be nice just to post-process infos with some Python (or 
> Elisp) script but then need to make texi2any to store paired @-commands there 
> also :-( yet need to find a way to distinguish them from @-commands that are 
> just mentioned in the text (in Texinfo manual for example)...</div>


(Please don't send HTML emails.)

What do you mean by "stretch lines"? Do you mean to justify the text?

I honestly think there is no point in adding an option for this for 
generating Info files. In fact, I'm opposed, as it is an unnecessary 
complication, and it might make it harder for a program that 
interprets Info files to decide what text needs to be refilled or 
rendered in a particular font. Justifying fixed-width text (which is 
what Info files were intended to be displayed as) makes the text harder 
to read due to the irregular size of spaces in the text.

There is no way to mark what text came from an @example in an Info file. 
The only possible way for a post-processor to know is to use heuristics 
based on line indentantion and/or line length. If you can work out how 
to do this in Elisp, maybe you could get it included in the Info mode of
Emacs.

Perl does my head in, too.



reply via email to

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