unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* understanding fill-region, paragraph-separate, and paragraph-start
@ 2018-12-11 21:47 Eric Abrahamsen
  2018-12-11 22:47 ` Stephen Berman
  2018-12-12  2:16 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Abrahamsen @ 2018-12-11 21:47 UTC (permalink / raw)
  To: help-gnu-emacs

In EBDB I've been using a manual function to correctly format record
fields. Briefly, the output looks just like BBDB:

John Doe
   mail: email1@address.com, email2@address.com, email3@address.com
  notes: This is John Doe, a guy I met in blah blah blah blah blah

In narrow windows, I want the above two lines to fill/wrap like so:

John Doe
   mail: email1@address.com, email2@address.com,
         email3@address.com
  notes: This is John Doe, a guy I met in blah blah
         blah blah blah

So each line has an overhanging label, and subsequent lines are filled
to the beginning of the text on the first line.

Right now this is done "manually" with a function that just goes in and
sticks in spaces.

In the interest of Doing the Right Thing (and learning how filling
works), I'm trying to accomplish the same thing by setting the correct
values of `fill-column', `paragraph-separate', and `paragraph-start',
and then calling `fill-region' on all the lines at once.

I haven't been able to get this right. I think the regexp I want is
"[^:]+: ", meaning a paragraph starts with some stuff that's not a
colon, then a colon and a space. But if I use that as the value of
`paragraph-start', nothing happens (the lines still look like example
one above), if I use it as the value of `paragraph-separate' the region
is turned into a single line (but wrapped to `fill-column'), and if I
use it as the value of both the region is turned into a single long line
that isn't filled.

I'll worry about the underhang later -- how is this meant to work? I
also thought `paragraph-separate' might be a "\n", but that goes back to
doing nothing.

And hints much appreciated!

Eric




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-12-13 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-11 21:47 understanding fill-region, paragraph-separate, and paragraph-start Eric Abrahamsen
2018-12-11 22:47 ` Stephen Berman
2018-12-12  0:15   ` Eric Abrahamsen
2018-12-12 11:07     ` Stephen Berman
2018-12-12 19:18       ` Eric Abrahamsen
2018-12-12  2:16 ` Stefan Monnier
2018-12-13 21:48   ` Eric Abrahamsen

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).