emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: vc-dired-hook -vs- vc-call


From: Tom Tromey
Subject: Patch: vc-dired-hook -vs- vc-call
Date: Sun, 06 Jan 2008 09:42:18 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (gnu/linux)

Yesterday I tried vc-dired on a mercurial-managed working directory.
Once it was showing I typed 'v t'.  To my surprise I got an error
trace:

  require(vc-nil)
  vc-find-backend-function(nil dired-state-info)
  vc-call-backend(nil dired-state-info 
"/home/tromey/Mercurial/trunk/libcpp/ChangeLog.rej")
  vc-dired-hook()
  vc-dired-toggle-terse-mode()
  call-interactively(vc-dired-toggle-terse-mode nil nil)

I don't really understand this fully, I'm afraid.  vc-backend returns
nil for this file, because it has 'vc-backend as 'none.  This may be a
bug in vc-hg, I'm not sure; this file is ignored, not unregistered.

Anyway, this patch fixed it for me.  It seemed a bit better to use
vc-responsible-backend here.

Tom

2008-01-06  Tom Tromey  <address@hidden>

        * vc.el (vc-dired-hook): Use vc-responsible-backend.

Index: lisp/vc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc.el,v
retrieving revision 1.508
diff -u -r1.508 vc.el
--- lisp/vc.el  6 Jan 2008 16:02:38 -0000       1.508
+++ lisp/vc.el  6 Jan 2008 16:55:12 -0000
@@ -2417,7 +2417,9 @@
            (forward-line 1)))
         ;; Either we're in non-terse mode or it's out of date
         ((not (and vc-dired-terse-mode (vc-up-to-date-p filename)))
-         (vc-dired-reformat-line (vc-call dired-state-info filename))
+         (vc-dired-reformat-line
+          (vc-call-backend (vc-responsible-backend filename)
+                           'dired-state-info filename))
          (forward-line 1))
         ;; Remaining cases are under version control but uninteresting
         (t




reply via email to

[Prev in Thread] Current Thread [Next in Thread]