From: Stephen Berman <stephen.berman@gmx.net>
To: emacs-devel@gnu.org
Subject: Re: line/wrap-prefix patch
Date: Fri, 04 Jul 2008 22:50:57 +0200 [thread overview]
Message-ID: <8763rlpe4u.fsf@escher.local.home> (raw)
In-Reply-To: buoskury4zl.fsf@dhapc248.dev.necel.com
On Thu, 03 Jul 2008 13:19:10 +0900 Miles Bader <miles.bader@necel.com> wrote:
> Stephen Berman <stephen.berman@gmx.net> 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
next prev parent reply other threads:[~2008-07-04 20:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-30 3:38 line/wrap-prefix patch Miles Bader
2008-06-30 4:18 ` Miles Bader
2008-07-01 0:36 ` Miles Bader
2008-07-01 4:52 ` Chong Yidong
2008-07-01 5:38 ` Miles Bader
2008-07-01 14:10 ` Chong Yidong
2008-07-01 22:19 ` Stephen Berman
2008-07-03 4:19 ` Miles Bader
2008-07-04 20:50 ` Stephen Berman [this message]
2008-07-04 21:25 ` Stefan Monnier
2008-07-05 0:52 ` Miles Bader
2008-07-05 21:30 ` Stephen Berman
2008-07-06 1:05 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8763rlpe4u.fsf@escher.local.home \
--to=stephen.berman@gmx.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.