From: Miles Bader <miles@gnu.org>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: emacs-devel@gnu.org
Subject: Re: line/wrap-prefix patch
Date: Sat, 05 Jul 2008 09:52:17 +0900 [thread overview]
Message-ID: <87d4lt5f0e.fsf@catnip.gol.com> (raw)
In-Reply-To: <8763rlpe4u.fsf@escher.local.home> (Stephen Berman's message of "Fri, 04 Jul 2008 22:50:57 +0200")
Stephen Berman <stephen.berman@gmx.net> writes:
>> 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?
You can put the property over the entire region of text that the
wrap-prefix applies to; there's no need to know which words will
actually get wrapped.
>> 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
No.
>> 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.
The "right" indendation depends only on the text following the
preceding _hard_ line-start, i.e, the preceding "non-wrap prefix".
E.g., if you have the following long line:
- This is a long-line-aka-paragraph blah blah blah blah blah blah blah
and you want to have it wrapped (at display-time) like:
- This is a long-line-aka-paragraph blah
blah blah blah blah blah blah
The tricky part is getting the wrap-prefix " " by examining the
current non-wrap prefix, " - " in this case. Currently there's no
way of having the display engine do it, so one could alternatively have
a font-lock-like mechanism that turned hard paragraph prefixes into
wrap-prefix text properties. One could also try to come up with a
mechanism to have the display engine do it dynamically (as I talked
about a bit in my previous message).
> *********
> 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.
I haven't been able the reproduce it so far, so I need to try to do so
more thoroughly. I'll try to do so this weekend.
-Miles
--
Friendship, n. A ship big enough to carry two in fair weather, but only one
in foul.
next prev parent reply other threads:[~2008-07-05 0:52 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
2008-07-04 21:25 ` Stefan Monnier
2008-07-05 0:52 ` Miles Bader [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d4lt5f0e.fsf@catnip.gol.com \
--to=miles@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=stephen.berman@gmx.net \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).