Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Configuring fill-paragraph not to mash the subversion delimiter?

0 views
Skip to first unread message

Adam Funk

unread,
Mar 16, 2007, 5:21:48 PM3/16/07
to
Is there any easy way to set something in my ~/.emacs file so that
when I'm editing subversion commit messages and I use M-q to tidy up a
few lines of text, the fill-paragraph command will treat the standard
line

--This line, and those below, will be ignored--

as not being part of the paragraph, even if there is no blank line
before it?

David Hansen

unread,
Mar 16, 2007, 5:49:32 PM3/16/07
to

Adjusting `paragraph-start' and/or `paragraph-separate' should be
enough.

David

Matthew Flaschen

unread,
Mar 16, 2007, 7:50:34 PM3/16/07
to Adam Funk, emacs
Adam Funk wrote:
> Is there any easy way to set something in my ~/.emacs file so that
> when I'm editing subversion commit messages and I use M-q to tidy up a
> few lines of text, the fill-paragraph command will treat the standard
> line

What package are you using, psvn?

Try:

(add-hook 'svn-log-edit-mode-hook
(lambda ()
(setq paragraph-start (concat "\\(" paragraph-start "\\|--This
line, and those below, will be ignored--\\)"))))

It's getting duplicated for some reason, but that shouldn't affect the
functionality at all...

Matt Flaschen


Stefan Monnier

unread,
Mar 18, 2007, 11:52:06 PM3/18/07
to
>> Is there any easy way to set something in my ~/.emacs file so that when
>> I'm editing subversion commit messages and I use M-q to tidy up a few
>> lines of text, the fill-paragraph command will treat the standard line

> What package are you using, psvn?

> (add-hook 'svn-log-edit-mode-hook


> (lambda ()
> (setq paragraph-start (concat "\\(" paragraph-start "\\|--This
> line, and those below, will be ignored--\\)"))))

Actually, it's paragraph-separate that should be changed (otherwise some
words from subsequent lines could be yanked to the end of the "-- ... --"
line). Also the \\(..\\) is unnecessary because the \| operator has the
lowest precedence already, tho this doesn't make much difference.

(add-hook 'svn-log-edit-mode-hook
(lambda ()
(set (make-local-variable 'paragraph-separate)
(concat paragraph-separate
"\\|--This line, and those below, will be ignored--"))))


-- Stefan

Adam Funk

unread,
Mar 19, 2007, 1:10:01 PM3/19/07
to
On 2007-03-16, Matthew Flaschen wrote:

> Adam Funk wrote:
>> Is there any easy way to set something in my ~/.emacs file so that
>> when I'm editing subversion commit messages and I use M-q to tidy up a
>> few lines of text, the fill-paragraph command will treat the standard
>> line
>
> What package are you using, psvn?

Nothing, as far as I know. I use the svn command from the shell and
EDITOR='emacs -nw' --- Emacs comes up with the commit message in
Fundamental mode.

Matthew Flaschen

unread,
Mar 19, 2007, 7:59:24 PM3/19/07
to Adam Funk, emacs

Okay, then just add this to .emacs. It's necessary to set both start
and separate (separate alone doesn't work):

(setq paragraph-start (concat paragraph-start "\\|--This line, and those
below, will be ignored--"))
(setq paragraph-separate (concat paragraph-separate "\\|--This line, and
those below, will be ignored--"))

Matthew Flaschen


Petter Gustad

unread,
Mar 20, 2007, 3:48:40 PM3/20/07
to
Adam Funk <a24...@yahoo.com> writes:

You could use a function like this:

(defun subversion-fill-paragraph ()
"like fill-paragraph but only for region from start of buffer to the
subversion mark"
(interactive)
(let ((svn-string "--This line, and those below, will be ignored--")
(prevpoint (point))
(svn-point))
(goto-char (point-min))
(setf svn-point (search-forward svn-string))
(when svn-point
(fill-region (point-min) (- svn-point (length svn-string) 1)))
(goto-char prevpoint)))


But I would suggest that you use subversion from within emacs (much
easier) presumably svn-status (somewhat like dired) where you can
check-in (by the c command) and type the string in a buffer followed
by C-c C-c, or even use the vc- commands (c-x v v) to check in single
files.

Petter

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Adam Funk

unread,
Mar 21, 2007, 9:34:44 AM3/21/07
to
On 2007-03-19, Matthew Flaschen wrote:

> Okay, then just add this to .emacs. It's necessary to set both start
> and separate (separate alone doesn't work):

It's simple and it works.

Thanks!

Sam Peterson

unread,
Apr 6, 2007, 3:40:17 PM4/6/07
to
Adam Funk <a24...@yahoo.com> on Fri, 16 Mar 2007 21:21:48 +0000 didst step
forth and proclaim thus:

Methinks customizing paragraph-separate may prove fruitful. Something like:

(setq paragraph-separate (concat "--.*\?--\\|" paragraph-separate))

I don't know what *-hook variable is run for subversion commit messages. If
you find the right hook, just place the above code in a lambda or defun for it.

--
Sam Peterson
skpeterson At nospam ucdavis.edu
"if programmers were paid to remove code instead of adding it,
software would be much better" -- unknown

Adam Funk

unread,
Apr 6, 2007, 3:56:48 PM4/6/07
to
On 2007-04-06, Sam Peterson wrote:

> Methinks customizing paragraph-separate may prove fruitful. Something like:
>
> (setq paragraph-separate (concat "--.*\?--\\|" paragraph-separate))
>
> I don't know what *-hook variable is run for subversion commit messages. If
> you find the right hook, just place the above code in a lambda or defun for it.

Thanks, but Matthew Flaschen already gave me the simple answer [1]; I
put these lines in my ~/.emacs and that solved it:

(setq paragraph-start (concat paragraph-start "\\|--This line, and those below, will be ignored--"))
(setq paragraph-separate (concat paragraph-separate "\\|--This line, and those below, will be ignored--"))


[1] Message-ID: <mailman.1142.11743488...@gnu.org>

0 new messages