bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Klaus Berndl
Subject: Re: C-x C-q more useful as toggle-read-only
Date: 24 Oct 2000 10:00:19 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

On 23 Oct 2000, Paul D. Smith wrote:

>  %% MFerguson@peinc.com (Mickey Ferguson) writes:
>  
>    mf> Eli Zaretskii <eliz@is.elta.co.il> wrote in message
>  
>    >> > | > Please change C-x C-q back to doing toggle-read-only.
>  
>    >> I don't have strong feelings about this myself, but I'd say it's too
>    >> late: "C-x C-q" has a VC meaning since v19.29.  So it's probably well
>    >> entrenched by now, as there are generations of users whose only
>    >> interface with VC is "C-x C-q".
>  
>    mf> Eli, I know how long you've been involved in emacs, especially in
>    mf> giving support, so I certainly value your opinion.  But I would
>    mf> claim that C-x C-q has been set to toggle-read-only for far longer
>    mf> than since 19.29.  The VC people stole it out from under the
>    mf> existing default definition.  If they VC folks want their
>    mf> variation, they should redefine it in their .emacs files.
>    mf> Precedent is important, as you've indicated.  We just have to
>    mf> recall where a precedent was first set.
>  
>  C-xC-q was toggle-read-only before VC came along--that's why VC chose
>  it: the idea is that to turn a read-only file into a a read-write file
>  when that file is under SCC requires a checkout operation (in most SC
>  tools)--so that's what C-xC-q does for those types of files.
>  
>  According to the ONEWS file in Emacs 20.7, this change was actually made
>  for the first release of Emacs 19, when VC was introduced; that means
>  the last version of Emacs to have an un-VC-ified C-xC-q was 18.58.
>  
>  I believe Eli's point is not that C-xC-q has always been VC-aware, but
>  rather that it's been that way for so long that it is now the default.
>  The time to protest the change was seven years ago, back when it was
>  first made (the first public release of Emacs 19 was on 22 May, 1993).
>  By now far too many people are far to used to the current behavior to
>  switch it back purely on "precedent" grounds.
>  

Look at this, this comes from the vc-hooks.el distributed with Emacs 20.7.

,----
| (defun vc-toggle-read-only (&optional verbose)
|   "Change read-only status of current buffer, perhaps via version control.
| If the buffer is visiting a file registered with version control,
| then check the file in or out.  Otherwise, just change the read-only flag
| of the buffer.
| With prefix argument, ask for version number to check in or check out.
| Check-out of a specified version number does not lock the file;
| to do that, use this command a second time with no argument."
|   (interactive "P")
|   (if (or (and (boundp 'vc-dired-mode) vc-dired-mode)
|           ;; use boundp because vc.el might not be loaded
|           (vc-backend (buffer-file-name)))
|       (vc-next-action verbose)
|     (toggle-read-only)))
| (define-key global-map "\C-x\C-q" 'vc-toggle-read-only)
`----


If a file is under version control IMHO toggle-read-only makes no sense, in
such a case your options are to check out, uncheckout or check in.
If a file is not under version control then toggle-read-only makes sense.
So look at *vc-toggle-read-only* (look above). This function does exactly this.
For my Emacs 20.7 C-x C-q is bound to this *vc-toggle-read-only* and i´m happy.

To make *vc-toggle-read-only* satisfy all (even senseless :-) wishes the
optional argument *verbose* (not very useful IMHO) could be replaced by an
optional argument *force-toggle* so if called with prefix-argument, toggling
read-only even under version-control is done (but this is in my eyes not very
useful too :-)

I´m wondering in which respect the current behavior of *vc-toggle-read-only*
doesn´t satisfy some people??

Therefore: IMHO it´s not to late, because nothing is do to.

Klaus

-- 
Klaus Berndl                    mailto: klaus.berndl@sdm.de
sd&m AG                         http://www.sdm.de
software design & management    
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220



reply via email to

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