emacs-devel
[Top][All Lists]
Advanced

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

Re: line/wrap-prefix patch


From: Stephen Berman
Subject: Re: line/wrap-prefix patch
Date: Fri, 04 Jul 2008 22:50:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On Thu, 03 Jul 2008 13:19:10 +0900 Miles Bader <address@hidden> wrote:

> Stephen Berman <address@hidden> writes:
>> My final comment concerns adaptive filling.  In my modification of
>> longlines.el long lines are appropriately wrapped at different levels of
>> indentation, resulting in displays like this:
> ..
>> With your patch, doing (setq wrap-prefix
>> (fill-context-prefix (line-beginning-position) (line-end-position)))
>> results in a display like this:
> ...
>> It would be nice to get the appropriate indentation.
>
> To get varying prefixes, you can use the `wrap-prefix' text property.

Yes, I see this when I evaluate e.g. (put-text-property (point) (1+
(point)) 'wrap-prefix "    ") with the cursor on the first character of
a wrapped word.  Is this the right way to use this text property?

> To do so automatically and dynamically would be interesting, but is
> obviously more work.  

If my usage above is correct, I think this approach would effectively
need to be augmented by something like longlines.el.  If I just enable
word wrapping and set wrap-prefix text properties as above, then as soon
as I add enough text to force new word wrapping before a position
indented by the wrap-prefix property, that indentation is lost.  Without
line wrapping via post-command-hook a la longlines.el I don't see how to
reliably retain the indentation after such changes in the previous text,
at least at the lisp level (the alternative would be to integrate
"adaptive indentation" into redisplay, as you did with "simple"
indentation).

>                       I wonder what ways of specifying the prefix would
> be practical (e.g., a text-property covering the "header" text at the
> beginning of the physical line, which would be replaced by spaces to get
> the wrap prefix, or a regexp used to match the header)?

I don't see how any "static" text property assignment will insure the
right indentation when the preceding text changes and forces new word
wrapping.

*********
I was really hoping you would respond to the display problem at
window-start.  I find it very dissatisfying to regard this as a
"misfeature" of Emacs redisplay and leave it that, as RMS seemed to
conclude was the only course to take.  Is it so infeasible to rework
window-start to handle indented wrapped lines?  I feel pretty helpless
when it comes to the Emacs C core, but if you or anyone would you point
me to the locus of this "misfeature" in the code I would be grateful.

Steve Berman





reply via email to

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