unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Configuring fill-paragraph not to mash the subversion delimiter?
@ 2007-03-16 21:21 Adam Funk
  2007-03-16 21:49 ` David Hansen
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Adam Funk @ 2007-03-16 21:21 UTC (permalink / raw)
  To: help-gnu-emacs

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?

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

* Re: Configuring fill-paragraph not to mash the subversion delimiter?
  2007-03-16 21:21 Configuring fill-paragraph not to mash the subversion delimiter? Adam Funk
@ 2007-03-16 21:49 ` David Hansen
  2007-03-16 23:50 ` Matthew Flaschen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: David Hansen @ 2007-03-16 21:49 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, 16 Mar 2007 21:21:48 +0000 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 
>
> --This line, and those below, will be ignored--
>
> as not being part of the paragraph, even if there is no blank line
> before it?

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

David

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

* Re: Configuring fill-paragraph not to mash the subversion delimiter?
  2007-03-16 21:21 Configuring fill-paragraph not to mash the subversion delimiter? Adam Funk
  2007-03-16 21:49 ` David Hansen
@ 2007-03-16 23:50 ` Matthew Flaschen
       [not found] ` <mailman.1038.1174089116.7795.help-gnu-emacs@gnu.org>
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Matthew Flaschen @ 2007-03-16 23:50 UTC (permalink / raw)
  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

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

* Re: Configuring fill-paragraph not to mash the subversion delimiter?
       [not found] ` <mailman.1038.1174089116.7795.help-gnu-emacs@gnu.org>
@ 2007-03-19  3:52   ` Stefan Monnier
  2007-03-19 17:10   ` Adam Funk
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2007-03-19  3:52 UTC (permalink / raw)
  To: help-gnu-emacs

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

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

* Re: Configuring fill-paragraph not to mash the subversion delimiter?
       [not found] ` <mailman.1038.1174089116.7795.help-gnu-emacs@gnu.org>
  2007-03-19  3:52   ` Stefan Monnier
@ 2007-03-19 17:10   ` Adam Funk
  2007-03-19 23:59     ` Matthew Flaschen
       [not found]     ` <mailman.1142.1174348863.7795.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 10+ messages in thread
From: Adam Funk @ 2007-03-19 17:10 UTC (permalink / raw)
  To: help-gnu-emacs

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.

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

* Re: Configuring fill-paragraph not to mash the subversion delimiter?
  2007-03-19 17:10   ` Adam Funk
@ 2007-03-19 23:59     ` Matthew Flaschen
       [not found]     ` <mailman.1142.1174348863.7795.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Matthew Flaschen @ 2007-03-19 23:59 UTC (permalink / raw)
  To: Adam Funk, emacs

Adam Funk wrote:
> 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.

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

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

* Re: Configuring fill-paragraph not to mash the subversion delimiter?
  2007-03-16 21:21 Configuring fill-paragraph not to mash the subversion delimiter? Adam Funk
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.1038.1174089116.7795.help-gnu-emacs@gnu.org>
@ 2007-03-20 19:48 ` Petter Gustad
  2007-04-06 19:40 ` Sam Peterson
  4 siblings, 0 replies; 10+ messages in thread
From: Petter Gustad @ 2007-03-20 19:48 UTC (permalink / raw)
  To: help-gnu-emacs

Adam Funk <a24061@yahoo.com> writes:

> 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?

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?

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

* Re: Configuring fill-paragraph not to mash the subversion delimiter?
       [not found]     ` <mailman.1142.1174348863.7795.help-gnu-emacs@gnu.org>
@ 2007-03-21 13:34       ` Adam Funk
  0 siblings, 0 replies; 10+ messages in thread
From: Adam Funk @ 2007-03-21 13:34 UTC (permalink / raw)
  To: help-gnu-emacs

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!

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

* Re: Configuring fill-paragraph not to mash the subversion delimiter?
  2007-03-16 21:21 Configuring fill-paragraph not to mash the subversion delimiter? Adam Funk
                   ` (3 preceding siblings ...)
  2007-03-20 19:48 ` Petter Gustad
@ 2007-04-06 19:40 ` Sam Peterson
  2007-04-06 19:56   ` Adam Funk
  4 siblings, 1 reply; 10+ messages in thread
From: Sam Peterson @ 2007-04-06 19:40 UTC (permalink / raw)
  To: help-gnu-emacs

Adam Funk <a24061@yahoo.com> on Fri, 16 Mar 2007 21:21:48 +0000 didst step
forth and proclaim thus:

> 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?

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

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

* Re: Configuring fill-paragraph not to mash the subversion delimiter?
  2007-04-06 19:40 ` Sam Peterson
@ 2007-04-06 19:56   ` Adam Funk
  0 siblings, 0 replies; 10+ messages in thread
From: Adam Funk @ 2007-04-06 19:56 UTC (permalink / raw)
  To: help-gnu-emacs

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.1174348863.7795.help-gnu-emacs@gnu.org>

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

end of thread, other threads:[~2007-04-06 19:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-16 21:21 Configuring fill-paragraph not to mash the subversion delimiter? Adam Funk
2007-03-16 21:49 ` David Hansen
2007-03-16 23:50 ` Matthew Flaschen
     [not found] ` <mailman.1038.1174089116.7795.help-gnu-emacs@gnu.org>
2007-03-19  3:52   ` Stefan Monnier
2007-03-19 17:10   ` Adam Funk
2007-03-19 23:59     ` Matthew Flaschen
     [not found]     ` <mailman.1142.1174348863.7795.help-gnu-emacs@gnu.org>
2007-03-21 13:34       ` Adam Funk
2007-03-20 19:48 ` Petter Gustad
2007-04-06 19:40 ` Sam Peterson
2007-04-06 19:56   ` Adam Funk

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