jed-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Paragraph reformatting functionality


On 20.01.06, Paul Boekholt wrote:
> On Fri, 20 Jan 2006 09:46:53 -0500, "John E. Davis" <davis@xxxxxxxxxxxxx> said:
> 
> > I hope the SegV did not occur in jed.

Unfortunately, it did.
 
> In structured_text.sl:

>    return orelse{line_is_empty()}{line_is_list()>0};
>    % attention: there is a segfault if the paragraph_separator_hook returns
>    % values higher than 1!
> 
> What Gunter probably tried first was
>    return orelse{line_is_empty()}{line_is_list()};

Exactly. That was it and it crashed jed (something I did not experience
for years).

> > > * By default, a line which is a paragraph separator doesnot get
> > >   formatted :-(
> 
> > I am not sure what you mean.  Do you have a simple example?


1) in (La)TeX mode, a line starting with a command (i.e. with "\") is
considered a paragraph separator. This is sometimes bad for 
\emph{inline commands} like in this example but little can be done.

  \item However, in an itemized or enumerated list, the first line of
  every item will not be formatted, as it is a paragraph separator.

2) the same holds for my stryctured text, where a list item should
separate paragraphs so that

  * first item
  * second item
  
will not be formatted as  

  * first item * second item
  
However, if the first line of an item "overflows", it will still not be
(re)formatted with format_paragraph().

While the imroved wrap-hook helps in the case of first-time writing,
later insertions or deletions might call for a reformatting. In my
writing this happens so often I feel the need to program a remedy.



 
> What he means is that in JED there is only a paragraph separator, while
> Emacs has a paragraph_separator and a paragraph_start:
> 
> | `paragraph-start' is a regexp that should match any line that either
> | starts or separates paragraphs.

    `paragraph-separate' is another regexp that should match only lines
    that separate paragraphs without being part of any paragraph (for
    example, blank lines)
    
> You can get around this by narrowing to the paragraph, as is done in
> e.g. email.sl, since the first paragraph in the buffer does not have a
> paragraph separator preceding it.

I'll try Johns hint with "mark_paragraph_hook" first.
 
> > >So maybe I have to write a format_paragraph from scratch.
> You could also comment out the line
> 	!if (bobp) go_down_1;
> in subpar.sl to get the desired effect.

Thanks for the tip, Paul. (subpar.sl *is* a rewrite from scratch of
format_paragraph, isn't it?)


Guenter

-- 
Milde ife.et.tu-dresden.de

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]