From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: 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 Organization: University of Cambridge Message-ID: References: Reply-To: Leo , 2623@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236882321 26947 80.91.229.12 (12 Mar 2009 18:25:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Mar 2009 18:25:21 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 12 19:26:34 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lhpbo-0002Bu-Gc for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Mar 2009 19:26:20 +0100 Original-Received: from localhost ([127.0.0.1]:54353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhpaS-0002tC-JJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Mar 2009 14:24:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhpZL-0002RJ-0v for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2009 14:23:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhpZJ-0002QD-4h for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2009 14:23:46 -0400 Original-Received: from [199.232.76.173] (port=41453 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhpZI-0002Pl-Nb for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2009 14:23:44 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:33828) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LhpZI-0000K9-57 for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2009 14:23:44 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2CINfoE023771; Thu, 12 Mar 2009 11:23:42 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n2CIF4E9021470; Thu, 12 Mar 2009 11:15:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Leo Original-Sender: news Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 12 Mar 2009 18:15:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2623 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123688132420088 (code B ref -1); Thu, 12 Mar 2009 18:15:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 12 Mar 2009 18:08:44 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2CI8f1P020082 for ; Thu, 12 Mar 2009 11:08:42 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhpKi-0003lj-TH for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2009 14:08:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhpKi-0003l2-Fg for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2009 14:08:40 -0400 Original-Received: from [199.232.76.173] (port=49708 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhpKi-0003ks-0m for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2009 14:08:40 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:33309 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LhpKh-0007An-GB for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2009 14:08:39 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LhpKe-000431-OX for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2009 18:08:37 +0000 Original-Received: from smaug.linux.pwf.cam.ac.uk ([193.60.95.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Mar 2009 18:08:36 +0000 Original-Received: from sdl.web by smaug.linux.pwf.cam.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Mar 2009 18:08:36 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: smaug.linux.pwf.cam.ac.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:HNX946rKJwpZlq3beC9YRHGL80E= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 12 Mar 2009 14:23:46 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:26268 gmane.emacs.pretest.bugs:24113 Archived-At: 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