[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-x 4 a ceased to work in *cvs-diff* buffer
From: |
Stefan |
Subject: |
Re: C-x 4 a ceased to work in *cvs-diff* buffer |
Date: |
Sun, 10 Oct 2004 17:45:03 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin) |
>> I can't reproduce this here. Could you give some more info?
> Perhaps two hours ago I updated my working copy, and it still
> happens. I proceeded as follows:
[...]
> And here is the *cvs-diff* buffer for tramp.el:
> pcl-cvs: descending directory lisp/net/
> Index: tramp.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/net/tramp.el,v
> retrieving revision 1.50
> diff -u -r1.50 tramp.el
> --- tramp.el 10 Aug 2004 20:49:45 -0000 1.50
> +++ tramp.el 10 Oct 2004 11:57:11 -0000
Hmm... it seems pcl-cvs decided to run `cvs diff' in `single-dir' mode
(i.e. one invocation per directory). So presumably `cvs-execute-single-dir'
is set to t. Could you check why that is? It's probably because
`cvs-version' is not initialized to a proper value.
The other problem is that diff-mode does not take advantage of the
annotation `pcl-cvs: descending directory lisp/net/': the code is simply
missing (the annotation is currently only used by pcl-cvs itself and by
cvs-status.el).
Could you try the patch below that tweaks diff-mode to pay attention to the
pcl-cvs annotation?
Stefan
--- orig/lisp/diff-mode.el
+++ mod/lisp/diff-mode.el
@@ -1,6 +1,7 @@
;;; diff-mode.el --- a mode for viewing/editing context diffs
-;; Copyright (C) 1998,1999,2000,01,02,03,2004 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+;; Free Software Foundation, Inc.
;; Author: Stefan Monnier <address@hidden>
;; Keywords: convenience patch diff
@@ -517,14 +518,16 @@
(list (if old (match-string 2) (match-string 4))
(if old (match-string 4) (match-string 2)))))))))
-(defun diff-find-file-name (&optional old)
+(defun diff-find-file-name (&optional old prefix)
"Return the file corresponding to the current patch.
-Non-nil OLD means that we want the old file."
+Non-nil OLD means that we want the old file.
+PREFIX is only used internally: don't use it."
(save-excursion
(unless (looking-at diff-file-header-re)
(or (ignore-errors (diff-beginning-of-file))
(re-search-forward diff-file-header-re nil t)))
(let ((fs (diff-hunk-file-names old)))
+ (if prefix (setq fs (mapcar (lambda (f) (concat prefix f)) fs)))
(or
;; use any previously used preference
(cdr (assoc fs diff-remembered-files-alist))
@@ -546,6 +549,13 @@
(and (string-match "\\.rej\\'" (or buffer-file-name ""))
(let ((file (substring buffer-file-name 0 (match-beginning 0))))
(when (file-exists-p file) file)))
+ ;; If we haven't found the file, maybe it's because we haven't paid
+ ;; attention to the PCL-CVS hint.
+ (and (not prefix)
+ (boundp 'cvs-pcl-cvs-dirchange-re)
+ (save-excursion
+ (re-search-backward cvs-pcl-cvs-dirchange-re nil t))
+ (diff-find-file-name old (match-string 1)))
;; if all else fails, ask the user
(let ((file (read-file-name (format "Use file %s: " (or (first fs) ""))
nil (first fs) t (first fs))))
@@ -1422,5 +1432,5 @@
;; use `combine-after-change-calls' to minimize the slowdown of font-lock.
;;
-;;; arch-tag: 2571d7ff-bc28-4cf9-8585-42e21890be66
+;; arch-tag: 2571d7ff-bc28-4cf9-8585-42e21890be66
;;; diff-mode.el ends here