GNU bug report logs - #18535
tramp alters `vc-handled-backends'

Previous Next

Package: emacs;

Reported by: Emilio Lopes <eclig <at> gmx.net>

Date: Tue, 23 Sep 2014 10:55:02 UTC

Severity: normal

Merged with 18647

Found in version 24.4.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 18535 <at> debbugs.gnu.org (full text, mbox):

From: Emilio Lopes <eclig <at> gmx.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 18535 <at> debbugs.gnu.org
Subject: Re: bug#18535: tramp alters `vc-handled-backends'
Date: Thu, 25 Sep 2014 09:10:04 +0200
2014-09-23 17:37 GMT+02:00 Stefan Monnier <monnier <at> iro.umontreal.ca>:
>> `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))))))))




This bug report was last modified 10 years and 233 days ago.

Previous Next


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