From unknown Sun Jun 22 22:44:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18535: tramp alters `vc-handled-backends' 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: To: 18535@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.141146965810328 (code B ref -1); Tue, 23 Sep 2014 10:55:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Sep 2014 10:54:18 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 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 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 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 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 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) MIME-Version: 1.0 Received: by 10.220.163.194 with HTTP; Tue, 23 Sep 2014 03:53:38 -0700 (PDT) From: Emilio Lopes Date: Tue, 23 Sep 2014 12:53:38 +0200 X-Google-Sender-Auth: dZw7l_SsbNIiRnbfqGbbPVKInw8 Message-ID: Content-Type: text/plain; charset=UTF-8 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-Received-From: 208.118.235.17 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) `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) From unknown Sun Jun 22 22:44:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18535: tramp alters `vc-handled-backends' Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Sep 2014 15:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18535 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Emilio Lopes Cc: 18535@debbugs.gnu.org Received: via spool by 18535-submit@debbugs.gnu.org id=B18535.141148664416225 (code B ref 18535); Tue, 23 Sep 2014 15:38:02 +0000 Received: (at 18535) by debbugs.gnu.org; 23 Sep 2014 15:37:24 +0000 Received: from localhost ([127.0.0.1]:50102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWS9c-0004Dd-1N for submit@debbugs.gnu.org; Tue, 23 Sep 2014 11:37:24 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:33547) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWS9Z-0004DV-QS for 18535@debbugs.gnu.org; Tue, 23 Sep 2014 11:37:22 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVOnWBcZ/2dsb2JhbABZgwaDSsA9gRcXdIImAQEEViMQCw4mEhQYDSSIDNIZF456B4Q4BKsDg0wh X-IPAS-Result: ArUGAIDvNVOnWBcZ/2dsb2JhbABZgwaDSsA9gRcXdIImAQEEViMQCw4mEhQYDSSIDNIZF456B4Q4BKsDg0wh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="90657803" Received: from 167-88-23-25.cpe.teksavvy.com (HELO ceviche.home) ([167.88.23.25]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Sep 2014 11:37:21 -0400 Received: by ceviche.home (Postfix, from userid 20848) id D712066094; Tue, 23 Sep 2014 11:37:20 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Tue, 23 Sep 2014 11:37:20 -0400 In-Reply-To: (Emilio Lopes's message of "Tue, 23 Sep 2014 12:53:38 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > `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. The current code uses a `let' binding, which uses the same mechanism as unwind-protect, so I don't think that's the source of a the problem. The `delq' look dangerous on the other hand. Shouldn't these be `remq' instead? Stefan From unknown Sun Jun 22 22:44:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18535: tramp alters `vc-handled-backends' Resent-From: Emilio Lopes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Sep 2014 07:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18535 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 18535@debbugs.gnu.org Received: via spool by 18535-submit@debbugs.gnu.org id=B18535.141162903216694 (code B ref 18535); Thu, 25 Sep 2014 07:11:01 +0000 Received: (at 18535) by debbugs.gnu.org; 25 Sep 2014 07:10:32 +0000 Received: from localhost ([127.0.0.1]:51539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XX3CA-0004LA-FU for submit@debbugs.gnu.org; Thu, 25 Sep 2014 03:10:31 -0400 Received: from mail-vc0-f178.google.com ([209.85.220.178]:33434) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XX3C5-0004Ky-Co for 18535@debbugs.gnu.org; Thu, 25 Sep 2014 03:10:26 -0400 Received: by mail-vc0-f178.google.com with SMTP id lf12so5353734vcb.9 for <18535@debbugs.gnu.org>; Thu, 25 Sep 2014 00:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=WcTOSXLlDL9TvcveEJ2SIatNI3FXfTt8meb0rlxiZS0=; b=eA5/l4S0EDpODslHmMRy3O19dzpSgrBk4HReYITB/z2FaykeT/veYBS+xv49fM4tcb 5XN+ic2nSUT1YyIALEU5dca8OJCLf7Es5k/0rSVQOIDO29s6hJ0bic3e1hPxAixcildj yPcbtdRRXv+938lAGIeSgeP1d3eDerko5HPkdop1nHKXd+FvPnyirGWP85unXqtADqyP x0oS9edVx9iaK5xYj0lAGEYo9zojsS9sp+LSW9AZKLdCPQVgK5kbf4QDSWiUAh6ZIqPd 9vaa0WLE2TJEsFYxMVJutvNnQ7HWhRFxM9Jg/dCfZvc93+DuiVsxd2pNWWWSjd3Sxk0A YzWg== X-Received: by 10.52.107.101 with SMTP id hb5mr8311129vdb.31.1411629024070; Thu, 25 Sep 2014 00:10:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.163.194 with HTTP; Thu, 25 Sep 2014 00:10:04 -0700 (PDT) In-Reply-To: References: From: Emilio Lopes Date: Thu, 25 Sep 2014 09:10:04 +0200 X-Google-Sender-Auth: vYoWDEMepxWn4T3BugDytOlq-PA Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2014-09-23 17:37 GMT+02:00 Stefan Monnier : >> `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. > > The current code uses a `let' binding, which uses the same mechanism as > unwind-protect, so I don't think that's the source of a the problem. Is this common behavior in Lisps? I could not find any reference to this in the Elisp manual. Anyway, thanks for point this out! > The `delq' look dangerous on the other hand. Shouldn't these be > `remq' instead? yes, this seems to solve the problem. === 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-25 07:07:25 +0000 @@ -3464,19 +3464,19 @@ (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))) + (setq vc-handled-backends (remq '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))) + (setq vc-handled-backends (remq '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))) + (setq vc-handled-backends (remq 'Hg vc-handled-backends))) ;; Run. (ignore-errors (tramp-run-real-handler 'vc-registered (list file)))))))) From unknown Sun Jun 22 22:44:33 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Emilio Lopes Subject: bug#18535: closed (Re: bug#18535: tramp alters `vc-handled-backends') Message-ID: References: X-Gnu-PR-Message: they-closed 18535 X-Gnu-PR-Package: emacs Reply-To: 18535@debbugs.gnu.org Date: Thu, 25 Sep 2014 13:08:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1411650483-24904-1" This is a multi-part message in MIME format... ------------=_1411650483-24904-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #18535: tramp alters `vc-handled-backends' which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 18535@debbugs.gnu.org. --=20 18535: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18535 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1411650483-24904-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 18535-done) by debbugs.gnu.org; 25 Sep 2014 13:07:45 +0000 Received: from localhost ([127.0.0.1]:51744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XX8lt-0006TD-Be for submit@debbugs.gnu.org; Thu, 25 Sep 2014 09:07:45 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:14338) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XX8lp-0006T4-Vb for 18535-done@debbugs.gnu.org; Thu, 25 Sep 2014 09:07:42 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVOnWBcZ/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMQCw4mEhQYDSSIBAjSGReOegeEOASrA4NMIQ X-IPAS-Result: ArUGAIDvNVOnWBcZ/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMQCw4mEhQYDSSIBAjSGReOegeEOASrA4NMIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="90847492" Received: from 167-88-23-25.cpe.teksavvy.com (HELO pastel.home) ([167.88.23.25]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Sep 2014 09:07:41 -0400 Received: by pastel.home (Postfix, from userid 20848) id ECA526011B; Thu, 25 Sep 2014 09:07:40 -0400 (EDT) From: Stefan Monnier To: Emilio Lopes Subject: Re: bug#18535: tramp alters `vc-handled-backends' Message-ID: References: Date: Thu, 25 Sep 2014 09:07:40 -0400 In-Reply-To: (Emilio Lopes's message of "Thu, 25 Sep 2014 09:10:04 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 18535-done Cc: 18535-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> The current code uses a `let' binding, which uses the same mechanism as >> unwind-protect, so I don't think that's the source of a the problem. > Is this common behavior in Lisps? I could not find any reference to > this in the Elisp manual. The Elisp manual's description is not in terms of implementation, so it doesn't say that, but it does document that behavior. E.g.: When that local binding is no longer in effect, the previously shadowed value (or lack of one) comes back. >> The `delq' look dangerous on the other hand. Shouldn't these be >> `remq' instead? > yes, this seems to solve the problem. Thanks, installed, Stefan ------------=_1411650483-24904-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 Sep 2014 10:54:18 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 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 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 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 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 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) MIME-Version: 1.0 Received: by 10.220.163.194 with HTTP; Tue, 23 Sep 2014 03:53:38 -0700 (PDT) From: Emilio Lopes Date: Tue, 23 Sep 2014 12:53:38 +0200 X-Google-Sender-Auth: dZw7l_SsbNIiRnbfqGbbPVKInw8 Message-ID: Subject: tramp alters `vc-handled-backends' To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 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-Received-From: 208.118.235.17 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) `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) ------------=_1411650483-24904-1-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 06 22:41:05 2014 Received: (at control) by debbugs.gnu.org; 7 Oct 2014 02:41:05 +0000 Received: from localhost ([127.0.0.1]:36069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XbKi0-0005eT-KX for submit@debbugs.gnu.org; Mon, 06 Oct 2014 22:41:04 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:56402) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XbKhz-0005eL-Bu for control@debbugs.gnu.org; Mon, 06 Oct 2014 22:41:03 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XbKhz-0006UE-32 for control@debbugs.gnu.org; Mon, 06 Oct 2014 22:41:03 -0400 Date: Mon, 06 Oct 2014 22:41:03 -0400 Message-Id: Subject: control message for bug 18647 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) forcemerge 18535 18647