|
From: | Dmitry Gutov |
Subject: | Re: electric-pair-mode as a minor mode? |
Date: | Sun, 12 Apr 2015 19:39:46 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 |
On 04/12/2015 04:16 PM, address@hidden (João Távora) wrote:
As a side note, a spurious "Summary: " prefix slipped through in the first line of the commit message, since I ammended my local commit from the command line, with emacsclient as EDITOR and then used M-p `log-edit-previous-comment' to pull in the last message. I saw 'Summary:' fontified so assumed it would be killed by `log-edit-mode'.
Thoughts:- I wonder why you didn't have the existing message already filled in the buffer, so you'd had to press `M-n'.
- This kind of commit message buffers should probably use a different major mode: after all, the format of the contents is different.
- vc-git supports the "amend" feature, so you shouldn't have had to use the command line; although it's a bit awkward when you want just to edit the message, and there are no changes in any files: then `vc-next-action' doesn't even initiate commit. We should integrate it with `log-view-modify-change-comment'.
Something like (defun log-edit--strip-headers-maybe () (save-excursion (goto-char (point-min)) (when (and (search-forward-regexp "^Summary:[ \t]+" (line-end-position) t) (y-or-n-p "Possibly spurious \"Summary:\" header detected. Remove?")) (delete-region (match-beginning 0) (match-end 0)))))
Maybe somewhere in `before-save-hook' of the new major mode?
[Prev in Thread] | Current Thread | [Next in Thread] |