all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Patch: vc-dired-hook -vs- vc-call
@ 2008-01-06 16:42 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2008-01-06 16:42 UTC (permalink / raw)
  To: emacs-devel

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  <tromey@redhat.com>

	* 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-06 16:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-06 16:42 Patch: vc-dired-hook -vs- vc-call Tom Tromey

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.