GNU bug report logs - #5773
23.1; vc-diff save buffer when re-diffing (or save whole fileset)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Kevin Ryde <user42@HIDDEN>; dated Thu, 25 Mar 2010 22:47:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 5773 <at> debbugs.gnu.org:


Received: (at 5773) by debbugs.gnu.org; 31 Mar 2010 00:36:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 30 20:36:29 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Nwlv2-0001Dc-Tf
	for submit <at> debbugs.gnu.org; Tue, 30 Mar 2010 20:36:29 -0400
Received: from mailout2-3.pacific.net.au ([61.8.2.226]
	helo=mailout2.pacific.net.au)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gg@HIDDEN>) id 1Nwluz-0001DX-W8
	for 5773 <at> debbugs.gnu.org; Tue, 30 Mar 2010 20:36:27 -0400
Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au
	[61.8.2.162])
	by mailout2.pacific.net.au (Postfix) with ESMTP id 091BC1B0AEC;
	Wed, 31 Mar 2010 11:36:20 +1100 (EST)
Received: from blah.blah (ppp2AAA.dyn.pacific.net.au [61.8.42.170])
	by mailproxy1.pacific.net.au (Postfix) with ESMTP id 543868C55;
	Wed, 31 Mar 2010 11:36:16 +1100 (EST)
Received: from gg by blah.blah with local (Exim 4.71)
	(envelope-from <gg@HIDDEN>)
	id 1Nwluv-0003bC-US; Wed, 31 Mar 2010 11:36:21 +1100
From: Kevin Ryde <user42@HIDDEN>
To: 5773 <at> debbugs.gnu.org
Subject: Re: 23.1; vc-diff save buffer when re-diffing (or save whole fileset)
References: <87pr2o6xlt.fsf@HIDDEN>
Date: Wed, 31 Mar 2010 11:36:21 +1100
In-Reply-To: <87pr2o6xlt.fsf@HIDDEN> (Chong Yidong's message of
	"Sun, 28 Mar 2010 15:43:26 -0400")
Message-ID: <87eij1cooq.fsf@HIDDEN>
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -3.6 (---)
X-Debbugs-Envelope-To: 5773
Cc: Chong Yidong <cyd@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.6 (---)

Chong Yidong <cyd@HIDDEN> writes:
>
> There are
> several other places in VC where vc-buffer-sync is called; could you
> check whether they need to use your `vc-buffer-sync-fileset'

Apart from vc-update which I mentioned, I can spot

    vc-register
    vc-revert
    vc-rollback

vc-revert and vc-rollback look like they could go straight to
vc-buffer-sync-fileset, but vc-register has extra trickery.

I have to confess I've never used anything more than vc-diff and
vc-next-action :-), so I'd be afraid to touch the rest.  Would you like
to start with vc-diff doing the right thing and take the rest on notice?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#5773; Package emacs. Full text available.

Message received at 5773 <at> debbugs.gnu.org:


Received: (at 5773) by debbugs.gnu.org; 28 Mar 2010 19:43:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 28 15:43:33 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1NvyOT-0007A7-L4
	for submit <at> debbugs.gnu.org; Sun, 28 Mar 2010 15:43:33 -0400
Received: from pantheon-po33.its.yale.edu ([130.132.50.94])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <cyd@HIDDEN>) id 1NvyOR-0007A0-JL
	for 5773 <at> debbugs.gnu.org; Sun, 28 Mar 2010 15:43:32 -0400
Received: from furry (173-14-147-246-NewEngland.hfc.comcastbusiness.net
	[173.14.147.246]) (authenticated bits=0)
	by pantheon-po33.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id
	o2SJhQCf020949
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 28 Mar 2010 15:43:26 -0400
Received: by furry (Postfix, from userid 1000)
	id 60EB7C05D; Sun, 28 Mar 2010 15:43:26 -0400 (EDT)
From: Chong Yidong <cyd@HIDDEN>
To: Kevin Ryde <user42@HIDDEN>
Subject: Re: 23.1; vc-diff save buffer when re-diffing (or save whole fileset)
Date: Sun, 28 Mar 2010 15:43:26 -0400
Message-ID: <87pr2o6xlt.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed)
X-Spam-Score: -3.0 (---)
X-Debbugs-Envelope-To: 5773
Cc: 5773 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.0 (---)

> If you re-run M-x vc-diff from a *vc-diff* buffer, it doesn't ask you
> to save the buffer being diffed the way that it does when operating
> from that buffer itself
>
> 2010-03-25  Kevin Ryde  <user42 <at> zip.com.au>
>
> * vc.el (vc-buffer-sync-fileset): New function.
> (vc-diff): Use it to save all relevant file buffers no matter
> where run (not just the current buffer).

Thanks, but I think your patch may need to go further.  There are
several other places in VC where vc-buffer-sync is called; could you
check whether they need to use your `vc-buffer-sync-fileset' (which
ought to be in vc-dispatcher.el)?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#5773; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Mar 2010 22:46:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 25 18:46:29 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Nuvoq-0006rw-Jl
	for submit <at> debbugs.gnu.org; Thu, 25 Mar 2010 18:46:29 -0400
Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gg@HIDDEN>) id 1Nuvoo-0006rr-3a
	for submit <at> debbugs.gnu.org; Thu, 25 Mar 2010 18:46:27 -0400
Received: from lists.gnu.org ([199.232.76.165]:55513)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <gg@HIDDEN>) id 1Nuvoj-0002xF-U1
	for submit <at> debbugs.gnu.org; Thu, 25 Mar 2010 18:46:21 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nuvoj-00031S-By
	for bug-gnu-emacs@HIDDEN; Thu, 25 Mar 2010 18:46:21 -0400
Received: from [140.186.70.92] (port=38265 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nuvmi-0001tN-6G
	for bug-gnu-emacs@HIDDEN; Thu, 25 Mar 2010 18:46:21 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 
	T_TVD_MIME_NO_HEADERS autolearn=unavailable version=3.3.0
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gg@HIDDEN>) id 1Nuvlv-00049p-T6
	for bug-gnu-emacs@HIDDEN; Thu, 25 Mar 2010 18:43:29 -0400
Received: from mailout2-3.pacific.net.au ([61.8.2.226]:40962
	helo=mailout2.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gg@HIDDEN>) id 1Nuvlv-00049b-9n
	for bug-gnu-emacs@HIDDEN; Thu, 25 Mar 2010 18:43:27 -0400
Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au
	[61.8.2.162])
	by mailout2.pacific.net.au (Postfix) with ESMTP id 846CD1B2661
	for <bug-gnu-emacs@HIDDEN>; Fri, 26 Mar 2010 09:42:38 +1100 (EST)
Received: from blah.blah (ppp2F42.dyn.pacific.net.au [61.8.47.66])
	by mailproxy1.pacific.net.au (Postfix) with ESMTP id AA29E8C13
	for <bug-gnu-emacs@HIDDEN>; Fri, 26 Mar 2010 09:42:37 +1100 (EST)
Received: from gg by blah.blah with local (Exim 4.71)
	(envelope-from <gg@HIDDEN>) id 1Nuvl9-0001Ri-Ts
	for bug-gnu-emacs@HIDDEN; Fri, 26 Mar 2010 09:42:40 +1100
From: Kevin Ryde <user42@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 23.1; vc-diff save buffer when re-diffing (or save whole fileset)
Date: Fri, 26 Mar 2010 09:42:39 +1100
Message-ID: <87pr2sja5c.fsf@HIDDEN>
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -5.6 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.6 (-----)

--=-=-=

If you re-run M-x vc-diff from a *vc-diff* buffer, it doesn't ask you to
save the buffer being diffed the way that it does when operating from
that buffer itself

    C-x C-f /some/file/under/vc/control
    C-x v =
    C-x o
    # edit the file's buffer a bit
    C-x o           # back to the *vc-diff*
    C-x v =

    => doesn't ask about saving the edits

I wonder also if vc-diff might offer to save the whole of its "fileset",
something like below.  Not that I'm not smart enough to diff more than
one file at a time :-)

Maybe `vc-update' could share this `vc-buffer-sync-fileset' too.
I thought to use find-buffer-visiting instead of the way vc-update has
`member' in its save-some-buffers, just in case there's symlinks making
names look different.

2010-03-25  Kevin Ryde  <user42@HIDDEN>

	* vc.el (vc-buffer-sync-fileset): New function.
	(vc-diff): Use it to save all relevant file buffers no matter
	where run (not just the current buffer).


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=vc.el.diff-save.diff

--- vc.el.~1.746.~	2009-12-17 08:25:35.000000000 +1100
+++ vc.el	2010-03-24 10:43:14.000000000 +1100
@@ -1593,9 +1593,17 @@
   (interactive (list current-prefix-arg t))
   (if historic
       (call-interactively 'vc-version-diff)
-    (when buffer-file-name (vc-buffer-sync not-urgent))
-    (vc-diff-internal t (vc-deduce-fileset t) nil nil
-		      (called-interactively-p 'interactive))))
+    (let ((fileset (vc-deduce-fileset t)))
+      (vc-buffer-sync-fileset fileset not-urgent)
+      (vc-diff-internal t fileset nil nil
+			(called-interactively-p 'interactive)))))
+
+(defun vc-buffer-sync-fileset (fileset not-urgent)
+  (dolist (filename (cadr fileset))
+    (let ((buffer (find-buffer-visiting filename)))
+      (if buffer
+	  (with-current-buffer buffer
+	    (vc-buffer-sync not-urgent))))))
 
 ;;;###autoload
 (defun vc-root-diff (historic &optional not-urgent)

--=-=-=




In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5)
 of 2009-09-14 on raven, modified by Debian
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default-enable-multibyte-characters: t

--=-=-=--





Acknowledgement sent to Kevin Ryde <user42@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#5773; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.