[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: electric-pair-mode as a minor mode?
From: |
Dmitry Gutov |
Subject: |
Re: electric-pair-mode as a minor mode? |
Date: |
Mon, 13 Apr 2015 02:10:05 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 |
On 04/13/2015 01:16 AM, address@hidden (João Távora) wrote:
(I pressed `M-p', not `M-n').
Right, that.
That's right. Although I can't resist asking why these "Summary" and
"Author" hints/cookies can't be some display-only element like a
before-string in an overlay. Why are they implemented as actual buffer
text?
I guess partly because it can be handled similarly to mail buffers (and
maybe, at some point, some code can be merged).
And while "Summary:" could be implemented as a before-string on an
overlay (or even purely with font-lock, maybe), other headers need extra
processing: transform the value, move it to a different part of the
buffer, etc. Aside from "Author" and "Signed-Off-By", we can encounter
"Fixes:" and now, after the ChangeLogs conversion,
"Copyright-paperwork-exempt:" and "Also-By:" (or some alternative thereof).
And good luck saving/restoring overlays in M-n/M-p implementations. Text
prop-based implementation would handle this better, but how to use them
in this context isn't necessarily apparent to me.
Never tried it. Didn't know they existed even. I make commits from
vc-dir and command line alternately as is more convenient, so I
`log-edit-mode' in COMMIT_EDITMSG for a consistent UI.
I'm guessing git-commit-mode from MELPA would probably be a better fit,
even if it has different interface.
Maybe somewhere in `before-save-hook' of the new major mode?
Won't kick in when the buffer doesn't need saving.
But COMMIT_EDITMSG needs to be saved, doesn't it?
This seems works nicely though:
log-edit-callback looks like a nice option, too.
Got it in my .emacs, but perhaps this could be installed, seems generic
enough.
It should probably handle other headers as well. I don't know if Git
allows to set arguments like --author or --signed-off-by via some
special comments in the commit file, but if it did, that would allow to
unify the implementations nicely.
Re: electric-pair-mode as a minor mode?, Lars Magne Ingebrigtsen, 2015/04/15
- Re: electric-pair-mode as a minor mode?, João Távora, 2015/04/16
- Re: electric-pair-mode as a minor mode?, Lars Magne Ingebrigtsen, 2015/04/16
- Re: electric-pair-mode as a minor mode?, João Távora, 2015/04/16
- Re: electric-pair-mode as a minor mode?, Lars Magne Ingebrigtsen, 2015/04/16
- Re: electric-pair-mode as a minor mode?, João Távora, 2015/04/26
- Re: electric-pair-mode as a minor mode?, Lars Magne Ingebrigtsen, 2015/04/26
- Re: electric-pair-mode as a minor mode?, Stefan Monnier, 2015/04/26