From ebff325e4317a1ff8d6a86976a2dc9f78697b21a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 12 Nov 2010 08:44:46 -0500 Subject: [PATCH] * lisp/vc/vc.el (vc-deduce-backend): Use default-directory in shell-mode and compilation-mode. Fixes: debbugs:7350 --- lisp/ChangeLog | 3 +++ lisp/vc/vc.el | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4b1e880e547..d7388d5b4f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2010-11-12 Stefan Monnier + * vc/vc.el (vc-deduce-backend): Use default-directory in shell-mode + and compilation-mode (bug#7350). + * vc/smerge-mode.el (smerge-refine): Choose better default part to highlight when one of them is empty. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 665dafb10df..56bf353b6b4 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -920,7 +920,8 @@ 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) + ;; Maybe we could even use comint-mode rather than shell-mode? + ((derived-mode-p 'dired-mode 'shell-mode 'compilation-mode) (vc-responsible-backend default-directory)) (vc-mode (vc-backend buffer-file-name)))) @@ -986,7 +987,7 @@ current buffer." (let ((backend (vc-responsible-backend default-directory))) (unless backend (error "Directory not under VC")) (list backend - (dired-map-over-marks (dired-get-filename nil t) nil)))) + (dired-map-over-marks (dired-get-filename nil t) nil)))) (defun vc-ensure-vc-buffer () "Make sure that the current buffer visits a version-controlled file." -- 2.39.5