[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#2553: *vc-diff* buffers are read-only, but M-k works

From: Stefan Monnier
Subject: bug#2553: *vc-diff* buffers are read-only, but M-k works
Date: Mon, 12 Sep 2011 21:26:03 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]