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: Mon, 13 Apr 2015 02:10:05 +0300 Message-ID: <552AFB4D.4090407@yandex.ru> References: <552A9FD2.8040307@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1428880227 22295 80.91.229.3 (12 Apr 2015 23:10:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Apr 2015 23:10:27 +0000 (UTC) Cc: Lars Magne Ingebrigtsen , Stefan Monnier , emacs-devel@gnu.org To: joaotavora@gmail.com (João Távora) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 13 01:10:22 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 1YhR1B-0003TW-KC for ged-emacs-devel@m.gmane.org; Mon, 13 Apr 2015 01:10:21 +0200 Original-Received: from localhost ([::1]:46486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhR1A-0006dX-FH for ged-emacs-devel@m.gmane.org; Sun, 12 Apr 2015 19:10:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhR16-0006dB-M3 for emacs-devel@gnu.org; Sun, 12 Apr 2015 19:10:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhR10-0007rx-QS for emacs-devel@gnu.org; Sun, 12 Apr 2015 19:10:16 -0400 Original-Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:33607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhR10-0007rg-KO for emacs-devel@gnu.org; Sun, 12 Apr 2015 19:10:10 -0400 Original-Received: by wgin8 with SMTP id n8so63857133wgi.0 for ; Sun, 12 Apr 2015 16:10:09 -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=cxMfMCwWDhIak1urSPWtgyz3jhvOl1l9+XjO0plJn4A=; b=t5in5n0qJbfbfLnTGcJs/hfdsX4RyrxrYKnBpFy5mj/80W+5GprWgs67fsFlqOhxbc TudDG5pBQ9e2uQy29r7VoVePfhj9gLba26RQsVK7NZ0YUSXcFv05ZTn1T2Hxss0/caQ3 /LSKqjwiFudYHYUwIjfHcC9futnbrOyJNcKTz6SIas2AdTDoiAd+zD0AmI9n+13icpsA B2cyS8sc87ehPqy4Z4pYM+N8Spja3la2sSsTfoxNsvw1OJhnbiRcRvP4ZPn3jigN3Orm 7x42SsoAYek8rpfdsgzbxoPIjgWklazfONkogSFSylFUUPImPfmkKQ4D8Q9LCjH8p5Xt RvbQ== X-Received: by 10.180.75.73 with SMTP id a9mr16372873wiw.45.1428880209810; Sun, 12 Apr 2015 16:10:09 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id e18sm8836181wjz.27.2015.04.12.16.10.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Apr 2015 16:10:08 -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:c00::230 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:185363 Archived-At: On 04/13/2015 01:16 AM, joaotavora@gmail.com (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.