From: Stefan <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: C-x 4 a ceased to work in *cvs-diff* buffer
Date: Sun, 10 Oct 2004 17:45:03 -0400 [thread overview]
Message-ID: <m1brfal5rr.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86vfdi6ajr.fsf@ketchup.de.uu.net> (Kai Grossjohann's message of "Sun, 10 Oct 2004 14:07:52 +0200")
>> 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 <monnier@cs.yale.edu>
;; 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
next prev parent reply other threads:[~2004-10-10 21:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-06 10:55 C-x 4 a ceased to work in *cvs-diff* buffer Kai Grossjohann
2004-06-06 22:33 ` Richard Stallman
2004-10-10 3:33 ` Stefan
2004-10-10 12:07 ` Kai Grossjohann
2004-10-10 12:20 ` Kai Grossjohann
2004-10-10 21:45 ` Stefan [this message]
2004-10-23 20:06 ` Kai Grossjohann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1brfal5rr.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.