From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: electric-pair-mode as a minor mode? Date: Sun, 12 Apr 2015 19:39:46 +0300 Message-ID: <552A9FD2.8040307@yandex.ru> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1428856816 31936 80.91.229.3 (12 Apr 2015 16:40:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Apr 2015 16:40:16 +0000 (UTC) Cc: Lars Magne Ingebrigtsen , emacs-devel@gnu.org To: joaotavora@gmail.com (João Távora), Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 12 18:40:11 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YhKvY-0007U6-Uu for ged-emacs-devel@m.gmane.org; Sun, 12 Apr 2015 18:40:09 +0200 Original-Received: from localhost ([::1]:45824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhKvY-0003nG-11 for ged-emacs-devel@m.gmane.org; Sun, 12 Apr 2015 12:40:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhKvL-0003n8-B0 for emacs-devel@gnu.org; Sun, 12 Apr 2015 12:39:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhKvH-0005yg-8f for emacs-devel@gnu.org; Sun, 12 Apr 2015 12:39:55 -0400 Original-Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:34638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhKvH-0005xs-2I for emacs-devel@gnu.org; Sun, 12 Apr 2015 12:39:51 -0400 Original-Received: by widjs5 with SMTP id js5so48181803wid.1 for ; Sun, 12 Apr 2015 09:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=AbVs89IEtx7DYxB/8HRVA4SzTOVrQFmKDpMYhyQ0qWw=; b=p7Eal9vxRGplgm1p8hd7tqMBu6bHGULJQpkIn8wbAvObxewAqwtVZLCgzJD0RVvQYR 8sHBMtWPPQ41GvFqZlpdpqGsiUx+dhPhaxFWSOX1OQn1F8P7rDeaaaqGfl0Cpp3jU4Kv Rnk4tKO06FmXNASUuFa4jCduQ/L8U2rpQEq/SY8z1KJPLSnqLQ+kU8Z3tWbPZbWkD5NJ CeZDqiCWOBq4RyJi4pYcVKvCh15wD122CmbXV4MzfFSdfNefLv/dA2QgV2pM1vUzhxkM 9cMI9Dwn1oKufPRBYztk1e+NdW/J+OircBQOm9ThNjRfZkGTI3CiSFiRGy+wASJaXQoJ R8DQ== X-Received: by 10.180.99.42 with SMTP id en10mr9929221wib.83.1428856790376; Sun, 12 Apr 2015 09:39:50 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id h5sm7638803wjn.20.2015.04.12.09.39.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Apr 2015 09:39:49 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185348 Archived-At: On 04/12/2015 04:16 PM, joaotavora@gmail.com (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?