From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: How to inhibit version control for a single command. Date: Thu, 21 Aug 2003 16:52:54 -0600 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <3F454D46.7080105@yahoo.com> References: <5x4r0d9ma7.fsf@kfs2.cua.dk> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1061577169 14287 80.91.224.253 (22 Aug 2003 18:32:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Aug 2003 18:32:49 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Aug 22 20:32:47 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19qGiN-0004uP-00 for ; Fri, 22 Aug 2003 20:32:47 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19qGme-0002u8-00 for ; Fri, 22 Aug 2003 20:37:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19qFCg-0002rw-W3 for emacs-devel@quimby.gnus.org; Fri, 22 Aug 2003 12:55:58 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19q9n4-0007Vp-3p for emacs-devel@gnu.org; Fri, 22 Aug 2003 07:09:10 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19q8Vt-00017E-8J for emacs-devel@gnu.org; Fri, 22 Aug 2003 05:47:52 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19pykl-0007AR-N6 for emacs-devel@gnu.org; Thu, 21 Aug 2003 19:22:03 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19pyJK-0006bq-00 for ; Fri, 22 Aug 2003 00:53:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19pyJJ-0006bi-00 for ; Fri, 22 Aug 2003 00:53:41 +0200 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 19pyIN-0007Jk-00 for ; Fri, 22 Aug 2003 00:52:43 +0200 Original-Lines: 47 Original-X-Complaints-To: usenet@sea.gmane.org User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16074 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16074 Kim F. Storm wrote: > In ido, I used to be able to let bind vc-master-templates to nil to > temporarily inhibit version control for a single command (e.g. avoid > the CVS up-to-date check when the CVS repository is accessed over a > slow WAN link). I have used a similar hack in connection with M-x > grep where I don't want to have the up-to-date check just to look at > the matching lines. > > Now the vc-master-templates variable is obsolete and it's suggested to > use vc-BACKEND-master-templates instead, but then I have to let bind > several variables to accomplish the same effect. > > Now the question is: is there a simple way in the current vc.el to > temporarily disable vc while opening a file. How about adding this: (defmacro with-vc-disabled (&rest body) "Execute BODY forms with version control disabled. Temporarily bind `vc-rcs-master-templates' and `vc-sccs-master-templates' to nil." `(let ((vc-rcs-master-templates nil) (vc-sccs-master-templates nil)) ,@body)) (put 'with-vc-disabled 'lisp-indent-function 0) Or better yet: (defmacro with-vc-disabled (&rest body) "Execute BODY forms with version control disabled. Temporarily bind all `vc-BACKEND-master-templates' variables to nil." (let ((template-symbols nil) (template-regexp "\\`vc-\\(\\sw\\|\\s_\\)+-master-templates\\'")) (mapatoms (lambda (symbol) (if (and (boundp symbol) (string-match template-regexp (symbol-name symbol))) (setq template-symbols (cons symbol template-symbols))))) `(let ,(mapcar (lambda (symbol) (list symbol nil)) (nreverse template-symbols)) ,@body))) -- Kevin Rodgers