GNU bug report logs - #2623
23.0.91; File is under version-control; use C-x v v to check in/out

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Tue, 10 Mar 2009 10:35:06 UTC

Severity: minor

Tags: fixed

Fixed in version 24.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #70 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: emacs-pretest-bug <at> gnu.org
Subject: Re: bug#2623: 23.0.91; File is under version-control; use C-x v v to check in/out
Date: Thu, 12 Mar 2009 18:08:22 +0000
On 2009-03-12 00:39 +0000, Stefan Monnier wrote:
>>>>> BTW, why did you type C-x C-q?  Is the file read-only?
>>>> Sometimes I turn the file into read-only before showing to other people
>>>> in case they accidentally type something into it.
>>> I see, so in this case we could probably avoid the message by being
>>> a bit more clever (e.g. don't show the message if it's not the first
>>> time C-x C-q is used in this buffer).
>> There is difference between turning the buffer into read-only and the
>> file on disk being read-only. VC backends depend on the latter for their
>> status based on my experience with RCS. So showing such a message does
>
> No, actually VC did make buffers read-only based on the backend's
> status rather than just based on the file's own read-onlyness.  And
> C-x C-q was used by many people as the main way to interact with VC
> (both to check out and to check back in).  I know it all sounds really
> odd seen from today's point of view, but it still made sense in
> Emacs-21, which isn't that old.

The message is wrong when the underlying vc backend does not use such a
backward mechanism. However, toggle-read-only unconditionally show this
message.

This situation can be improved by a one line change:

--- /tmp/emacs/share/emacs/23.0.60/lisp/files.el.gz
+++ /tmp/buffer-content-32645B0g
@@ -4429,7 +4429,7 @@
       (view-mode-enter))
      (t (setq buffer-read-only (not buffer-read-only))
         (force-mode-line-update)))
-    (if (vc-backend buffer-file-name)
+    (if (memq (vc-backend buffer-file-name) '(RCS SCCS))
         (message "%s" (substitute-command-keys
                   (concat "File is under version-control; "
                           "use \\[vc-next-action] to check in/out"))))))

Diff finished.  Thu Mar 12 17:56:16 2009

I have no idea whether SCCS uses read-only mechanism tho. But it is
better to delete this 'message' from toggle-read-only. It looks out of
place and it is not even documented in the doc string.

I am curious how would C-x C-q have anything to do with vc. Even when
using RCS backend, it never is part of the work flow.

>         Stefan

-- 
.:  Leo  :.  [ sdl.web AT gmail.com ]  .: I use Emacs :.

               www.git-scm.com
    git - the one true version control system






This bug report was last modified 13 years and 320 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.