* Re: *vc-diff* buffers are read-only, but M-k works
@ 2009-03-04 15:41 Chong Yidong
2009-03-04 15:54 ` bug#2553: " Juanma Barranquero
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Chong Yidong @ 2009-03-04 15:41 UTC (permalink / raw)
To: emacs-devel; +Cc: David Reitter, 2553
David Reitter <david.reitter@gmail.com> wrote:
> M-k works just fine in read-only *vc-diff* buffers.
>
> However, undoing an M-k command is impossible, as is cutting, pasting,
> or all the other things that I did all the time in *vc-diff* buffers
> in Emacs 22.
>
> The M-k thing is a bug, the read-only (default?) setting is annoying.
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?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#2553: *vc-diff* buffers are read-only, but M-k works
2009-03-04 15:41 *vc-diff* buffers are read-only, but M-k works Chong Yidong
@ 2009-03-04 15:54 ` Juanma Barranquero
2009-03-04 15:54 ` Juanma Barranquero
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Juanma Barranquero @ 2009-03-04 15:54 UTC (permalink / raw)
To: Chong Yidong; +Cc: David Reitter, 2553, emacs-devel
On Wed, Mar 4, 2009 at 16:41, Chong Yidong <cyd@stupidchicken.com> wrote:
> 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?
Most operations on diff-mode buffers do not change the buffer or are
easily reversible (diff-reverse-direction, diff-unified->context,
etc.). Making the buffer read-write is a C-x C-q away, if the user
needs to use undo or normal editing commands.
What is a bit of a pain is that the user cannot easily setup vc-diff
to default to a read-write buffer, because there's no vc-diff-hook and
`(setq buffer-read-only t)' is done after calling diff-mode, so
diff-mode-hook isn't useful either. The only way right now (other than
modifying the source) is to advise vc-diff.
My 0.02€
Juanma
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: *vc-diff* buffers are read-only, but M-k works
2009-03-04 15:41 *vc-diff* buffers are read-only, but M-k works Chong Yidong
2009-03-04 15:54 ` bug#2553: " Juanma Barranquero
@ 2009-03-04 15:54 ` Juanma Barranquero
2011-09-11 21:46 ` bug#2553: " Lars Magne Ingebrigtsen
2011-09-11 21:46 ` Lars Magne Ingebrigtsen
3 siblings, 0 replies; 9+ messages in thread
From: Juanma Barranquero @ 2009-03-04 15:54 UTC (permalink / raw)
To: Chong Yidong; +Cc: David Reitter, 2553, emacs-devel
On Wed, Mar 4, 2009 at 16:41, Chong Yidong <cyd@stupidchicken.com> wrote:
> 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?
Most operations on diff-mode buffers do not change the buffer or are
easily reversible (diff-reverse-direction, diff-unified->context,
etc.). Making the buffer read-write is a C-x C-q away, if the user
needs to use undo or normal editing commands.
What is a bit of a pain is that the user cannot easily setup vc-diff
to default to a read-write buffer, because there's no vc-diff-hook and
`(setq buffer-read-only t)' is done after calling diff-mode, so
diff-mode-hook isn't useful either. The only way right now (other than
modifying the source) is to advise vc-diff.
My 0.02€
Juanma
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#2553: *vc-diff* buffers are read-only, but M-k works
2009-03-04 15:41 *vc-diff* buffers are read-only, but M-k works Chong Yidong
2009-03-04 15:54 ` bug#2553: " Juanma Barranquero
2009-03-04 15:54 ` Juanma Barranquero
@ 2011-09-11 21:46 ` Lars Magne Ingebrigtsen
2011-09-11 21:46 ` Lars Magne Ingebrigtsen
3 siblings, 0 replies; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-11 21:46 UTC (permalink / raw)
To: Chong Yidong; +Cc: 2553, emacs-devel, David Reitter
Chong Yidong <cyd@stupidchicken.com> writes:
> 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.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: *vc-diff* buffers are read-only, but M-k works
2009-03-04 15:41 *vc-diff* buffers are read-only, but M-k works Chong Yidong
` (2 preceding siblings ...)
2011-09-11 21:46 ` bug#2553: " Lars Magne Ingebrigtsen
@ 2011-09-11 21:46 ` Lars Magne Ingebrigtsen
2011-09-13 1:26 ` Stefan Monnier
2011-09-13 1:26 ` Stefan Monnier
3 siblings, 2 replies; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-11 21:46 UTC (permalink / raw)
To: Chong Yidong; +Cc: 2553, David Reitter, emacs-devel
Chong Yidong <cyd@stupidchicken.com> writes:
> 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.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#2553: *vc-diff* buffers are read-only, but M-k works
2011-09-11 21:46 ` Lars Magne Ingebrigtsen
2011-09-13 1:26 ` Stefan Monnier
@ 2011-09-13 1:26 ` Stefan Monnier
1 sibling, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2011-09-13 1:26 UTC (permalink / raw)
To: Lars Magne Ingebrigtsen; +Cc: 2553, Chong Yidong, David Reitter, emacs-devel
>> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: *vc-diff* buffers are read-only, but M-k works
2011-09-11 21:46 ` Lars Magne Ingebrigtsen
@ 2011-09-13 1:26 ` Stefan Monnier
2011-10-06 21:59 ` bug#2553: " Lars Magne Ingebrigtsen
2011-10-06 21:59 ` Lars Magne Ingebrigtsen
2011-09-13 1:26 ` Stefan Monnier
1 sibling, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2011-09-13 1:26 UTC (permalink / raw)
To: Lars Magne Ingebrigtsen; +Cc: 2553, Chong Yidong, emacs-devel, David Reitter
>> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#2553: *vc-diff* buffers are read-only, but M-k works
2011-09-13 1:26 ` Stefan Monnier
2011-10-06 21:59 ` bug#2553: " Lars Magne Ingebrigtsen
@ 2011-10-06 21:59 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-10-06 21:59 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 2553, emacs-devel, David Reitter
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> 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.
That would be even better, and is even more general.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: bug#2553: *vc-diff* buffers are read-only, but M-k works
2011-09-13 1:26 ` Stefan Monnier
@ 2011-10-06 21:59 ` Lars Magne Ingebrigtsen
2011-10-06 21:59 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-10-06 21:59 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 2553, Chong Yidong, David Reitter, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> 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.
That would be even better, and is even more general.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-10-06 21:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-04 15:41 *vc-diff* buffers are read-only, but M-k works Chong Yidong
2009-03-04 15:54 ` bug#2553: " Juanma Barranquero
2009-03-04 15:54 ` Juanma Barranquero
2011-09-11 21:46 ` bug#2553: " Lars Magne Ingebrigtsen
2011-09-11 21:46 ` Lars Magne Ingebrigtsen
2011-09-13 1:26 ` Stefan Monnier
2011-10-06 21:59 ` bug#2553: " Lars Magne Ingebrigtsen
2011-10-06 21:59 ` Lars Magne Ingebrigtsen
2011-09-13 1:26 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.