From: Andreas Politz <politza@fh-trier.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Reformatting Chat Protocol?
Date: Sun, 14 Nov 2010 21:24:29 +0100 [thread overview]
Message-ID: <8739r3slfm.fsf@fh-trier.de> (raw)
In-Reply-To: 847d35ff-14aa-44fc-9936-0130d97fe26d@z22g2000pri.googlegroups.com
"Felix E. Klee" <felix.klee@inka.de> writes:
> In a text file, I want to reformat a block as follows. Its a chat
> protocol with various lines longer than the value of `fill-column'.
>
> From:
>
> [11.11.2010 17:01:37] bla bla bla bla bla bla bla bla bla bla bla
> bla bla bla bla bla bla bla bla bla bla
> [11.11.2010 17:04:21] bla bla bla bla bla
> [11.11.2010 17:05:25] bla bla bla
>
> Into:
>
> [11.11.2010 17:01:37] bla bla bla bla bla bla bla bla bla bla bla
> bla bla bla bla bla bla bla bla bla bla
> [11.11.2010 17:04:21] bla bla bla bla bla bla bla bla bla
> [11.11.2010 17:05:25] bla bla bla
>
> Or:
>
> [11.11.2010 17:01:37] bla bla bla bla bla bla bla bla bla bla bla
> bla bla bla bla bla bla bla bla bla bla
> [11.11.2010 17:04:21] bla bla bla bla bla bla bla bla bla
> [11.11.2010 17:05:25] bla bla bla
>
> Any simple solution?
Try this, i.e. evaluate it in the chat buffer.
(progn
(mapc 'make-local-variable '(paragraph-start paragraph-separate))
(setq paragraph-start "\\["
paragraph-separate "$"
fill-prefix (make-string (length "[11.11.2010 17:05:25] ")
?\s))
(fill-region (point-min) (point-max)))
-ap
next prev parent reply other threads:[~2010-11-14 20:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-14 14:42 Reformatting Chat Protocol? Felix E. Klee
[not found] ` <87mxpcnefv.fsf@kuiper.lan.informatimago.com>
[not found] ` <5084d90b-b875-43cd-bbfe-ffa75d320ebb@a30g2000vbt.googlegroups.com>
2010-11-14 15:43 ` Pascal J. Bourguignon
2010-11-14 20:24 ` Andreas Politz [this message]
2010-11-14 21:30 ` Felix E. Klee
2010-11-17 2:27 ` 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=8739r3slfm.fsf@fh-trier.de \
--to=politza@fh-trier.de \
--cc=help-gnu-emacs@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.
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).