[Top][All Lists]

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

Re: Visual line mode in email citation

From: Stefan Monnier
Subject: Re: Visual line mode in email citation
Date: Mon, 31 May 2010 14:30:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> can use to make this wrapping do the right thing.
>> IOW, some Elisp code somewhere needs to add a `wrap-prefix' to each line
>> specifying the citation/indentation/fill prefix to use.  This should
>> most likely be done by a function passed to jit-lock-register and which
>> then uses something like fill-context-prefix.
> Why pass it to jit-lock-register?

Because it doesn't use any of font-lock's functionality.
Because it should work even if font-lock is turned off.

> Isn't it better to add it to font lock keywords. Then the frame work
> for handling changes in jit-lock is used, otherwise I can't see how it
> can be used, but I might be missing something.

C-h f jit-lock-register.
Font-lock uses jit-lock via jit-lock-register.  Check out glasses-mode
for another mode that uses jit-lock-register.

> (The code needs some restructuring to extract something similar to
> fill-context-prefix, which I do not think can be used as it is.)

fill-context-prefix can probably be used as-is, but it will probably not
be ideal: it may suffer from some minor problems, and the code is
overkill for such a situation (all the part of the code that tries to
look at the prefix on several lines will never apply).

So a new function is probably in order, tho ideally the two functions
should share a lot of code (either via a third function, or by having
fill-context-prefix call the new function).


reply via email to

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