From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emilio Lopes Newsgroups: gmane.emacs.bugs Subject: bug#18535: tramp alters `vc-handled-backends' Date: Tue, 23 Sep 2014 12:53:38 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1411470675 20326 80.91.229.3 (23 Sep 2014 11:11:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Sep 2014 11:11:15 +0000 (UTC) To: 18535@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 23 13:11:08 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XWNzr-0006Wa-3y for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Sep 2014 13:11:03 +0200 Original-Received: from localhost ([::1]:52393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWNzq-0000hQ-IY for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Sep 2014 07:11:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWNzm-0000hD-9y for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 07:10:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWNzg-0002ja-Me for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 07:10:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWNzg-0002ix-K4 for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 07:10:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XWNkM-0002hc-JO for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 06:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Emilio Lopes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Sep 2014 10:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18535 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141146965810328 (code B ref -1); Tue, 23 Sep 2014 10:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Sep 2014 10:54:18 +0000 Original-Received: from localhost ([127.0.0.1]:49500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWNjd-0002gV-Dt for submit@debbugs.gnu.org; Tue, 23 Sep 2014 06:54:18 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47522) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWNja-0002gM-Vd for submit@debbugs.gnu.org; Tue, 23 Sep 2014 06:54:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWNjZ-0006Mx-C3 for submit@debbugs.gnu.org; Tue, 23 Sep 2014 06:54:14 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:47366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWNjZ-0006MI-9C for submit@debbugs.gnu.org; Tue, 23 Sep 2014 06:54:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWNjS-0000O9-LR for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 06:54:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWNjR-0006Lp-2u for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 06:54:06 -0400 Original-Received: from mail-vc0-x230.google.com ([2607:f8b0:400c:c03::230]:39012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWNjQ-0006LC-Rf for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 06:54:04 -0400 Original-Received: by mail-vc0-f176.google.com with SMTP id la4so3495864vcb.21 for ; Tue, 23 Sep 2014 03:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=ngaBP39PWYe+64/QG8/Tj8Kv0QcHgvdPXFmmKwtpwZ8=; b=U9N3AhruwNiNKGtafmQGpc2B7S/CVO7NA+nzQEPWHV3YIGJQsEjJwcJoJ5+zajVW3l iAWxyksTdJU6IiSQHDK5Ck6IDICDtyl92+bO3mjPaSCZH75/AxkzlTFD6kMWjk7Uo04c KADhzwARogqKy2aBsDowxZQ9c7I1Y3d/zUf/tTAseiRcE8QVfVfAMxGPuuvTTJCpSxiQ eqWaRbXGMovGQW77ijVh75hCSDutx98EzwX7oix8zLXM6AvCVgOdAc2MpL4c6gEGoceB 4afpFkpygoEY9oxSrShdUWnIYQwUuPQ1ew3e2AFXWDCx6n/gyuRavlFLkR259dT+ktz1 zX2Q== X-Received: by 10.52.150.163 with SMTP id uj3mr19679306vdb.24.1411469639151; Tue, 23 Sep 2014 03:53:59 -0700 (PDT) Original-Received: by 10.220.163.194 with HTTP; Tue, 23 Sep 2014 03:53:38 -0700 (PDT) X-Google-Sender-Auth: dZw7l_SsbNIiRnbfqGbbPVKInw8 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93654 Archived-At: `tramp-sh-handle-vc-registered' can permanently alter the value of `vc-handled-backends' causing Emacs to stop recognizing version controlled files as such. This happened to me a couple of times after having pressed `C-g' while some `tramp' operation was apparently hanging. Here is a patch: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-16 13:36:04 +0000 +++ lisp/ChangeLog 2014-09-23 09:27:10 +0000 @@ -1,4 +1,9 @@ +2014-09-23 Emilio C. Lopes + + * net/tramp-sh.el (tramp-sh-handle-vc-registered): use `unwind-protect' + to avoid altering `vc-handled-backends' permanently. + 2014-09-22 Kan-Ru Chen * window.el (fit-window-to-buffer): When counting buffer width, count the whole visible buffer. Correctly convert the body-height === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2014-09-08 15:52:04 +0000 +++ lisp/net/tramp-sh.el 2014-09-23 09:27:10 +0000 @@ -3456,30 +3456,33 @@ ;; calls shall be answered from the file cache. We unset ;; `process-file-side-effects' and `remote-file-name-inhibit-cache' ;; in order to keep the cache. - (let ((vc-handled-backends vc-handled-backends) + (let ((vc-handled-backends-saved vc-handled-backends) remote-file-name-inhibit-cache process-file-side-effects) ;; Reduce `vc-handled-backends' in order to minimize process calls. - (when (and (memq 'Bzr vc-handled-backends) - (boundp 'vc-bzr-program) - (not (with-tramp-connection-property v vc-bzr-program - (tramp-find-executable - v vc-bzr-program (tramp-get-remote-path v))))) - (setq vc-handled-backends (delq 'Bzr vc-handled-backends))) - (when (and (memq 'Git vc-handled-backends) - (boundp 'vc-git-program) - (not (with-tramp-connection-property v vc-git-program - (tramp-find-executable - v vc-git-program (tramp-get-remote-path v))))) - (setq vc-handled-backends (delq 'Git vc-handled-backends))) - (when (and (memq 'Hg vc-handled-backends) - (boundp 'vc-hg-program) - (not (with-tramp-connection-property v vc-hg-program - (tramp-find-executable - v vc-hg-program (tramp-get-remote-path v))))) - (setq vc-handled-backends (delq 'Hg vc-handled-backends))) - ;; Run. - (ignore-errors - (tramp-run-real-handler 'vc-registered (list file)))))))) + (unwind-protect + (progn + (when (and (memq 'Bzr vc-handled-backends) + (boundp 'vc-bzr-program) + (not (with-tramp-connection-property v vc-bzr-program + (tramp-find-executable + v vc-bzr-program (tramp-get-remote-path v))))) + (setq vc-handled-backends (delq 'Bzr vc-handled-backends))) + (when (and (memq 'Git vc-handled-backends) + (boundp 'vc-git-program) + (not (with-tramp-connection-property v vc-git-program + (tramp-find-executable + v vc-git-program (tramp-get-remote-path v))))) + (setq vc-handled-backends (delq 'Git vc-handled-backends))) + (when (and (memq 'Hg vc-handled-backends) + (boundp 'vc-hg-program) + (not (with-tramp-connection-property v vc-hg-program + (tramp-find-executable + v vc-hg-program (tramp-get-remote-path v))))) + (setq vc-handled-backends (delq 'Hg vc-handled-backends))) + ;; Run. + (ignore-errors + (tramp-run-real-handler 'vc-registered (list file)))) + (setq vc-handled-backends vc-handled-backends-saved))))))) ;;;###tramp-autoload (defun tramp-sh-file-name-handler (operation &rest args)