git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bruce Stephens <bruce.stephens@isode.com>
To: Peter Simons <simons@cryp.to>
Cc: git@vger.kernel.org
Subject: Re: Emacs git-mode feature request: support fill-paragraph correctly
Date: Mon, 26 Jan 2009 19:11:59 +0000	[thread overview]
Message-ID: <8063k1zxts.fsf@tiny.isode.net> (raw)
In-Reply-To: <87mydet0yg.fsf@write-only.cryp.to> (Peter Simons's message of "Mon\, 26 Jan 2009 18\:46\:15 +0100")

Peter Simons <simons@cryp.to> writes:

[...]

> The buffer is in "log-edit" mode.

Ah, OK.  That makes sense.

>  > In that case you could stick this in your .emacs if you wanted to
>  > use message-mode:
>  >
>  > (setq auto-mode-alist (cons '("COMMIT_EDITMSG" . message-mode) auto-mode-alist))
>
> Unfortunately, it's not that easy.

True.  I don't use git-mode (well, not much).  I use git commit from
the command line, which runs emacsclient as its editor.

> I'm not an Emacs expert, but I'd assume that switching into a
> different mode would change the meaning of C-c C-c.

Yep.  Quite likely other things, too.

OK, something like this:

(add-hook 'log-edit-mode-hook (lambda ()
		(let ((regexp "--text follows this line--$\\|[  ]*$\\|-- $\\|---+$\\|^\f$\\|.*wrote:$\\|\\(\\([         ]*[-_.[:word:]]+>+\\|[  ]*[]>|}+]\\)+\\)[  ]*$\\|<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)"))
                   (setq paragraph-start regexp
                         paragraph-separate regexp)))

I copied the regexp from the value in message-mode.  (In a junk buffer
use M-x message-mode, then C-h v paragraph-start and copy & paste.)

I imagine large parts of the regexp aren't relevant for your purposes
so you could remove them if you wanted.  You might also define a
function rather than using lambda---that would make it a bit easier to
test.

  reply	other threads:[~2009-01-26 19:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-26 11:57 Emacs git-mode feature request: support fill-paragraph correctly Peter Simons
2009-01-26 12:15 ` Bruce Stephens
2009-01-26 17:46   ` Peter Simons
2009-01-26 19:11     ` Bruce Stephens [this message]
2009-01-27 11:03 ` Alexandre Julliard
2009-01-27 14:07   ` Peter Simons
2009-01-28 21:32     ` Junio C Hamano
2009-01-29 10:42       ` Alexandre Julliard

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: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8063k1zxts.fsf@tiny.isode.net \
    --to=bruce.stephens@isode.com \
    --cc=git@vger.kernel.org \
    --cc=simons@cryp.to \
    /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://80x24.org/mirrors/git.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).