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: trunk r115265: * lisp/vc/vc-dispatcher.el (vc-log-edit): Setup the Summary&Author headers. Date: Tue, 03 Dec 2013 01:02:00 +0200 Message-ID: <529D1168.9090102@yandex.ru> References: <871u1zes89.fsf@yandex.ru> <5298AA77.4060009@yandex.ru> <52991737.9000904@yandex.ru> <529A0C08.8010809@yandex.ru> <529BF309.4010109@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1386025339 30138 80.91.229.3 (2 Dec 2013 23:02:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Dec 2013 23:02:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 03 00:02:24 2013 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 1VncVU-00007t-BD for ged-emacs-devel@m.gmane.org; Tue, 03 Dec 2013 00:02:24 +0100 Original-Received: from localhost ([::1]:39374 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VncVT-0006qC-PC for ged-emacs-devel@m.gmane.org; Mon, 02 Dec 2013 18:02:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VncVJ-0006pD-Dq for emacs-devel@gnu.org; Mon, 02 Dec 2013 18:02:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VncVB-0005jb-19 for emacs-devel@gnu.org; Mon, 02 Dec 2013 18:02:13 -0500 Original-Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:61729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VncVA-0005jV-QZ for emacs-devel@gnu.org; Mon, 02 Dec 2013 18:02:04 -0500 Original-Received: by mail-wi0-f171.google.com with SMTP id ca18so5676339wib.4 for ; Mon, 02 Dec 2013 15:02:03 -0800 (PST) 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=ATZVAz3zg30Oy04xFlZuM/hKrEYeFR90n8GTEogE4RQ=; b=rkfXzojnfoPxZyHMUG1HePvq8Vcpf9FK7l7EkvVf2k+TKiZ7MdWRX3NduKBMd4SbF4 MMSQJlvNo/LCwesQWQhl9sWfeaXjaWlR8qKEUVi7jlubMnVQG4pWm4O7oZU263u93Rfu DqRlms6+YBzd3TgwA2gD5UZGAW5Dtlz2LwVCywoimX1NLde8WBwz3fia9uhqQr7ku6oE UubgCi3ujqDVgk8uuI4X7vN4A7JyfPKXIx62ETwxxJUuTkCrxRbSwkp9Ji8lqRV/5Lhq v+DtVjxFwCbznGTp1w7lBr2esXr8lh7UfdqythShj0onTjwcKEKeIojA4efjQ1ekByxT U9DQ== X-Received: by 10.194.241.228 with SMTP id wl4mr55948013wjc.2.1386025323732; Mon, 02 Dec 2013 15:02:03 -0800 (PST) Original-Received: from [192.168.10.2] ([62.228.136.233]) by mx.google.com with ESMTPSA id qc10sm127470734wic.9.2013.12.02.15.02.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Dec 2013 15:02:02 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 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::22b 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:166021 Archived-At: On 02.12.2013 15:53, Stefan Monnier wrote: > Go to your nearest file buffer and type: SPC C-x k RET > As you can see, you did choose the buffer to kill and yet you get > prompted to confirm you want to kill that buffer despite its > unsaved changes. Ah, thanks, now I get it. This issue is not new, so it didn't seem too important. > I think it's good to try and make the *VC-Log* (and the *mail*) buffers > behave similarly to file buffers in this respect. I don't see this problem with mail. When I'm in a message-mode buffer (say, writing a reply from Gnus), and I press C-x k RET, Emacs warns me that the buffer is modified and asks for confirmation. See the small patch at the bottom for log-edit. It seems to work, but I fear it may complicate some scenarios where buffers are killed automatically. > It's probably the case that log-edit-hide-buf needs to be revisited, > since it dates to before the rewrite of display-buffer, where Martin > arranged to better be able to "undo" a display-buffer (via bury-buffer > or quit-window). Guess so. === modified file 'lisp/vc/log-edit.el' --- lisp/vc/log-edit.el 2013-12-02 22:13:51 +0000 +++ lisp/vc/log-edit.el 2013-12-02 22:54:52 +0000 @@ -476,6 +476,7 @@ (set (make-local-variable 'font-lock-defaults) '(log-edit-font-lock-keywords t)) (make-local-variable 'log-edit-comment-ring-index) + (add-hook 'kill-buffer-hook 'log-edit-kill-buffer-prompt nil t) (hack-dir-local-variables-non-file-buffer)) (defun log-edit-hide-buf (&optional buf where) @@ -551,6 +552,11 @@ (quit-windows-on buf) (kill-buffer buf))) +(defun log-edit-kill-buffer-prompt () + (unless (ring-member log-edit-comment-ring (buffer-string)) + (or (yes-or-no-p "Discard the comment?") + (user-error "Aborted")))) + (defun log-edit-files () "Return the list of files that are about to be committed." (ignore-errors (funcall log-edit-listfun)))