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 23.01.06, G. Milde wrote:
> On 20.01.06, John E. Davis wrote:
> >
> > jed also supports a hook called "mark_paragraph", that will be called
> > instead of the "par_sep" hook.
>
> This is a good idea I will try and report on.

I managed to set up a working "mark_paragraph" for structured text. Now
the first line of a list item is formatted with "format_paragraph".
See http://jedmodes.sourceforge.net/cvs/mode/rst/structured_text.sl

However, when formatting, there is currently no "hanging indent", i.e.
with wrapping I get a hanging indent (as in the first topic)
and with "format_paragraph" at the second topic's first line this
changes to a "flat indent":

  * this is an example list topic that has a very long line so eventually it
    is going to be wrapped.
  * this is an example list topic that has a very long line so eventually
  it is going to be wrapped.

It seems like "format_paragraph" does not use the "wrap_hook"
automatically.

Just to be sure, I'll ask explicitely:

If I got it right, "format_paragraph" uses the following buffer-hooks in
order of precedence

      * "format_paragraph_hook"   % alternative function replacing default
                                  % behaviour
      * "mark_paragraph_hook"     % mark the current paragraph
                                  % (by line?)
      * "forward_paragraph_hook"  % get the paragraph boundaries
        "backward_paragraph_hook"
      * "par_sep"                 % define lines separating paragraphs

I am ignorant about the possible use of

      * wrap_hook
      * newline_indent_hook
      * indent_hook

for the reformatting.

So, maybe I have to write a new formatting routine (getting bits from
subpar.sl) that uses the wrap_hook to get the "hanging indent".


BTW: I use

   set_buffer_hook("format_paragraph_hook", "par");
   
in my set_programming_keys() function to have a nice formatting of
comments and it works well.

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]