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: Francesco Potorti`
Subject: Re: C-x C-q more useful as toggle-read-only
Date: 30 Oct 2000 16:24:59 +0100

address@hidden (Andre Spiegel) writes:

   So maybe it would be natural to have that C-x C-q binding for files
   with locking only, and even in that case it could be made into a user
   option, whereas C-x v v would be the general VC command for doing the
   right thing.
   
   Note though, that this requires a rather drastic change in the VC
   documentation, where C-x C-q is consistently documented as the main VC
   command.

That probably  wouldn't be  too difficult.  The  problem is that  it has
been that way for a long time now, and people have learned it that way.
   
   On the positive side, the new VC does handle the special case that
   someone complained about: if a file is "locked" (or "modified") but
   the buffer is read-only, then C-x C-q will simply make the buffer (and
   if needed, also the file) writable, because that is the most sensible
   thing to do in that situation.

What  about something like  what I  did for  me, that  is, ask  the user
whether really checking  out or just toggling the  read-only flag?  Like
this:

;;; Addition to 19.30
;;; Ask before using version control: maybe toggle-read-only is enough
(defadvice vc-toggle-read-only (around vc-ask activate)
  (if (and (vc-backend buffer-file-name)
           (y-or-n-p "Toggle version control status? "))
      ad-do-it
    (toggle-read-only)))




reply via email to

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