emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/vc.el,v


From: Eric S. Raymond
Subject: [Emacs-diffs] Changes to emacs/lisp/vc.el,v
Date: Wed, 14 May 2008 17:12:48 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Eric S. Raymond <esr>   08/05/14 17:12:40

Index: vc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc.el,v
retrieving revision 1.661
retrieving revision 1.662
diff -u -b -r1.661 -r1.662
--- vc.el       12 May 2008 18:49:07 -0000      1.661
+++ vc.el       14 May 2008 17:12:38 -0000      1.662
@@ -982,12 +982,19 @@
       (push node flattened))
     (nreverse flattened)))
 
+(defun vc-derived-from-dir-mode (&optional buffer)
+  "Are we in a VC-directory buffer, or do we have one as an ancestor?"
+  (let ((buffer (or buffer (current-buffer))))
+    (cond ((derived-mode-p 'vc-dir-mode) t)
+         (vc-parent-buffer (vc-derived-from-dir-mode vc-parent-buffer))
+         (t nil))))
+
 (defun vc-deduce-fileset (&optional observer)
   "Deduce a set of files and a backend to which to apply an operation and
 the common state of the fileset.  Return (BACKEND . FILESET)."
   (let* ((fileset (vc-dispatcher-selection-set observer))
          ;; FIXME: Store the backend in a buffer-local variable.
-         (backend (if (derived-mode-p 'vc-dir-mode)
+         (backend (if (vc-derived-from-dir-mode (current-buffer))
                       (vc-responsible-backend default-directory)
                     (assert (and (= 1 (length fileset))
                                  (not (file-directory-p (car fileset)))))




reply via email to

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