From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: *vc-diff* buffers are read-only, but M-k works Date: Mon, 12 Sep 2011 21:26:03 -0400 Message-ID: References: <87k575jnwl.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1315877180 21105 80.91.229.12 (13 Sep 2011 01:26:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2011 01:26:20 +0000 (UTC) Cc: 2553@debbugs.gnu.org, Chong Yidong , emacs-devel@gnu.org, David Reitter To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 13 03:26:15 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R3HlO-0007qf-Qp for ged-emacs-devel@m.gmane.org; Tue, 13 Sep 2011 03:26:14 +0200 Original-Received: from localhost ([::1]:48009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3HlI-0001xl-Kp for ged-emacs-devel@m.gmane.org; Mon, 12 Sep 2011 21:26:08 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3HlG-0001xU-RF for emacs-devel@gnu.org; Mon, 12 Sep 2011 21:26:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3HlF-0004kI-OI for emacs-devel@gnu.org; Mon, 12 Sep 2011 21:26:06 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:51785 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3HlF-0004kC-KP for emacs-devel@gnu.org; Mon, 12 Sep 2011 21:26:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAK2wbk5FxK3+/2dsb2JhbABCp295gVIBAQQBViMFCws0EhQYDSQuh1y3e4ZuBKAzhEM X-IronPort-AV: E=Sophos;i="4.68,371,1312171200"; d="scan'208";a="135965474" Original-Received: from 69-196-173-254.dsl.teksavvy.com (HELO ceviche.home) ([69.196.173.254]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 12 Sep 2011 21:26:03 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 4AA7C660B6; Mon, 12 Sep 2011 21:26:03 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sun, 11 Sep 2011 23:46:36 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:143955 Archived-At: >> The purpose of making the vc-diff buffer read-only (2007-11-10 change to >> vc.el) was so that people can use the read-only diff-mode bindings like >> "k" and "p". However, it's counter-intuitive that undo does not work. >> Probably the easiest fix is to define a diff-undo command that lifts the >> read-only restriction temporarily. Any thoughts? > Perhaps a more general solution would be possible here. I think there > probably are other "mostly-read-only" modes where you have one or two > special commands that alter the buffer, anyway. Like with `M-k'. > Perhaps there could be a buffer-local variable like > `undo-read-only-buffer' that if set, would allow `undo' to work in these > cases. Or we could record in the buffer-undo-list the fact the the modification was done with inhibit-read-only bound to non-nil, and bind it similarly during the undo. Stefan