unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7350: 24.0.50; make vc-deduce-backend smarter
@ 2010-11-06 22:18 Bob Rogers
  2010-11-07 20:03 ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Bob Rogers @ 2010-11-06 22:18 UTC (permalink / raw)
  To: 7350

   I notice that vc-root-diff only works if the current buffer is
visiting a version-controlled file, and in certain other buffer modes.
In particular, it works in dired-mode, where it uses the
default-directory, but not in shell-mode, which is not one of the
explicit special cases.  ISTM that using default-directory would make a
better default case, since that ought to DTRT in the majority of cases.
Indeed, one might be able to get rid of some of the other
vc-deduce-backend cases, since most such modes seem to need to set up
the right default-directory anyway.

					-- Bob Rogers
					   http://www.rgrjr.com/

------------------------------------------------------------------------
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 665dafb..ddeb546 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -920,9 +920,9 @@ Within directories, only files already under version control are noticed."
   (cond ((derived-mode-p 'vc-dir-mode)   vc-dir-backend)
 	((derived-mode-p 'log-view-mode) log-view-vc-backend)
 	((derived-mode-p 'diff-mode)     diff-vc-backend)
-	((derived-mode-p 'dired-mode)
-	 (vc-responsible-backend default-directory))
-	(vc-mode (vc-backend buffer-file-name))))
+	(vc-mode (vc-backend buffer-file-name))
+	(default-directory
+	 (vc-responsible-backend default-directory))))
 
 (declare-function vc-dir-current-file "vc-dir" ())
 (declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files))





^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-11-20 19:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-06 22:18 bug#7350: 24.0.50; make vc-deduce-backend smarter Bob Rogers
2010-11-07 20:03 ` Stefan Monnier
2010-11-07 21:41   ` Bob Rogers
2010-11-08 17:47     ` Stefan Monnier
2010-11-08 21:05       ` Bob Rogers
2010-11-12 13:48         ` Stefan Monnier
2010-11-14 23:21           ` Bob Rogers
2010-11-15 16:05             ` Stefan Monnier
2010-11-17  4:43               ` Bob Rogers
2010-11-17 13:31                 ` Stefan Monnier
2010-11-19  2:27                   ` Bob Rogers
2010-11-20 19:54           ` Bob Rogers

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).