From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Newsgroups: gmane.emacs.devel Subject: Re: C-x 4 a ceased to work in *cvs-diff* buffer Date: Sun, 10 Oct 2004 17:45:03 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <86vfi53qht.fsf@rumba.de.uu.net> <86vfdi6ajr.fsf@ketchup.de.uu.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1097444752 27035 80.91.229.6 (10 Oct 2004 21:45:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Oct 2004 21:45:52 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 10 23:45:41 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CGlVd-000222-00 for ; Sun, 10 Oct 2004 23:45:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CGlcX-0005Iu-IU for ged-emacs-devel@m.gmane.org; Sun, 10 Oct 2004 17:52:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CGlc0-0004wP-W4 for emacs-devel@gnu.org; Sun, 10 Oct 2004 17:52:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CGlc0-0004vl-4t for emacs-devel@gnu.org; Sun, 10 Oct 2004 17:52:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CGlc0-0004vg-0u for emacs-devel@gnu.org; Sun, 10 Oct 2004 17:52:16 -0400 Original-Received: from [206.47.199.163] (helo=simmts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CGlUz-0000Aa-Az for emacs-devel@gnu.org; Sun, 10 Oct 2004 17:45:01 -0400 Original-Received: from empanada.home ([70.48.80.6]) by simmts5-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20041010214233.ORZZ1635.simmts5-srv.bellnexxia.net@empanada.home>; Sun, 10 Oct 2004 17:42:33 -0400 Original-Received: by empanada.home (Postfix, from userid 502) id AE3C03184DF; Sun, 10 Oct 2004 17:45:03 -0400 (EDT) Original-To: Kai Grossjohann In-Reply-To: <86vfdi6ajr.fsf@ketchup.de.uu.net> (Kai Grossjohann's message of "Sun, 10 Oct 2004 14:07:52 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28194 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28194 >> 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 ;; 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