[Top][All Lists]

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

Re: C-x C-q more useful as toggle-read-only

From: Michael John Downes
Subject: Re: C-x C-q more useful as toggle-read-only
Date: 24 Oct 2000 16:30:09 -0400

Eli Zaretskii <address@hidden> writes:

> With all due respect, this scenario sounds so convoluted that I'd be
> surprised if many users have to deal with it.

My mail was intended to provide anecdotal support for the guy who
started this thread. All I'm saying is "Yes, I had trouble with C-x C-q
too." If he and I are the only ones who have managed to trip over their
own feet in this area, I agree there is no need to change Emacs. It
caused trouble often enough for me that I changed the key binding, but
that's probably just because I use Emacs a lot, not because the
troublesome combination of circumstances is easily arrived at.

> For starters, I don't understand why do you use find-file-read-only
> for finding a file that can be found using other methods.  You could,
> for example, use "find -anewer" or some such.  Emacs offers desktop.el
> that would avoid the necessity of remembering what file did you edit,
> and recentf.el which remembers a few files you used lately.  You could
> use C-x C-f, since any inadvertent changes can be easily undone with
> C-x u or M-x revert-buffer.

I use all of those at times (except find -a newer). The scenario I gave
was intended only as an example; in practice it seems that I have
arrived at a state of looking at a checked-out file in a read-only
buffer quite a few times, in more than one way, and though I do not
claim the ways I arrived there were always optimal I am pretty confident
that they would be judged reasonable by a jury of fellow Emacs users ...

Also as I said, that Emacs should choose first of all to prompt to
revert to the previous version seems a bit alarming under those
circumstances, particularly for users with less experience.

> > But in general it seems to me automatically doing version control
> > operations without confirmation violates the principle of least
> > surprise
> It's not automatic: you _did_ type "C-x C-q", didn't you?

Yes, but the key sequence is overloaded to perform two different
operations: toggle-read-only for normal files, check-in-or-out for
version-controlled files. Although they are indeed conceptually similar,
there is one particularly significant difference: the first one only changes
buffer state, whereas the second one changes things in the file system.
And the user may fail to notice the "RCS" or "CVS" indicator in the mode
line before they run the command.

For someone who has a pattern of usage such that C-x C-q is usually run
on version-controlled files, accidentally trying to use it for checking
in/out a non-vc file is completely harmless. Nothing really changes. For
someone with a reverse pattern of usage, however, if Emacs guesses
wrongly about what they intended to do, the results can be rather
drastic, confusing, and inconvenient to undo. That is why I think it is
a mistake to overload those two operations onto a single keystroke.

reply via email to

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