diff options
| author | Eric S. Raymond | 2008-05-14 17:12:38 +0000 |
|---|---|---|
| committer | Eric S. Raymond | 2008-05-14 17:12:38 +0000 |
| commit | 192350af69a3e439251af2520cd0626689edeadc (patch) | |
| tree | daffe92c4a9cd605cac7d835309d2b7c5a69b4a5 | |
| parent | 26a3b3103ccd60e900d38b9924b9f23cf5c5a0b4 (diff) | |
| download | emacs-192350af69a3e439251af2520cd0626689edeadc.tar.gz emacs-192350af69a3e439251af2520cd0626689edeadc.zip | |
Make vc-deduce-fileset do the right thing in derived buffers.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/vc.el | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 524dd2923f8..21fc108c895 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-05-14 Eric S. Raymond <esr@snark.thyrsus.com> | ||
| 2 | |||
| 3 | * vc.el (vc-deduce-fileset): Do the right thing when visting a | ||
| 4 | buffer (say, a log buffer or diff buffer) with a vc-dir buffer as parent. | ||
| 5 | |||
| 1 | 2008-05-14 John Paul Wallington <jpw@pobox.com> | 6 | 2008-05-14 John Paul Wallington <jpw@pobox.com> |
| 2 | 7 | ||
| 3 | * international/mule.el (convert-define-charset-argument): Remove | 8 | * international/mule.el (convert-define-charset-argument): Remove |
diff --git a/lisp/vc.el b/lisp/vc.el index 2795912dca1..d2791587fc3 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -982,12 +982,19 @@ Within directories, only files already under version control are noticed." | |||
| 982 | (push node flattened)) | 982 | (push node flattened)) |
| 983 | (nreverse flattened))) | 983 | (nreverse flattened))) |
| 984 | 984 | ||
| 985 | (defun vc-derived-from-dir-mode (&optional buffer) | ||
| 986 | "Are we in a VC-directory buffer, or do we have one as an ancestor?" | ||
| 987 | (let ((buffer (or buffer (current-buffer)))) | ||
| 988 | (cond ((derived-mode-p 'vc-dir-mode) t) | ||
| 989 | (vc-parent-buffer (vc-derived-from-dir-mode vc-parent-buffer)) | ||
| 990 | (t nil)))) | ||
| 991 | |||
| 985 | (defun vc-deduce-fileset (&optional observer) | 992 | (defun vc-deduce-fileset (&optional observer) |
| 986 | "Deduce a set of files and a backend to which to apply an operation and | 993 | "Deduce a set of files and a backend to which to apply an operation and |
| 987 | the common state of the fileset. Return (BACKEND . FILESET)." | 994 | the common state of the fileset. Return (BACKEND . FILESET)." |
| 988 | (let* ((fileset (vc-dispatcher-selection-set observer)) | 995 | (let* ((fileset (vc-dispatcher-selection-set observer)) |
| 989 | ;; FIXME: Store the backend in a buffer-local variable. | 996 | ;; FIXME: Store the backend in a buffer-local variable. |
| 990 | (backend (if (derived-mode-p 'vc-dir-mode) | 997 | (backend (if (vc-derived-from-dir-mode (current-buffer)) |
| 991 | (vc-responsible-backend default-directory) | 998 | (vc-responsible-backend default-directory) |
| 992 | (assert (and (= 1 (length fileset)) | 999 | (assert (and (= 1 (length fileset)) |
| 993 | (not (file-directory-p (car fileset))))) | 1000 | (not (file-directory-p (car fileset))))) |