GNU bug report logs - #6870
Make vc-root-diff work in more modes

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; Severity: minor; Reported by: rogers-emacs@HIDDEN; dated Tue, 17 Aug 2010 01:55:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 6870) by debbugs.gnu.org; 5 Jul 2011 20:58:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 16:58:24 2011
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 1QeChL-0005dC-BV
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2011 16:58:23 -0400
Received: from vm-emlprdomr-03.its.yale.edu ([130.132.50.144])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <cyd@HIDDEN>) id 1QeChJ-0005cz-CF
	for 6870 <at> debbugs.gnu.org; Tue, 05 Jul 2011 16:58:21 -0400
Received: from furball (dhcp128036014245.central.yale.edu [128.36.14.245])
	(authenticated bits=0)
	by vm-emlprdomr-03.its.yale.edu (8.14.4/8.14.4) with ESMTP id
	p65KwFoV017838
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
	Tue, 5 Jul 2011 16:58:15 -0400
From: Chong Yidong <cyd@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#6870: Make vc-root-diff work in more modes
References: <19561.60443.364109.899857@HIDDEN>
	<m3liwem5v7.fsf@HIDDEN>
	<jwv4o319ar3.fsf-monnier+emacs@HIDDEN>
	<m3vcvgam5m.fsf@HIDDEN>
	<jwv1uy43636.fsf-monnier+emacs@HIDDEN>
Date: Tue, 05 Jul 2011 16:58:14 -0400
In-Reply-To: <jwv1uy43636.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
	of "Tue, 05 Jul 2011 15:04:09 -0400")
Message-ID: <878vscla1l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Scanned-By: MIMEDefang 2.71 on 130.132.50.144
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: 6870
Cc: Lars Magne Ingebrigtsen <larsi@HIDDEN>, rogers-emacs@HIDDEN,
	6870 <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: -2.7 (--)

Stefan Monnier <monnier@HIDDEN> writes:

>> What about all buffers that have file names?  A la
>
>> (and (buffer-file-name)
>>      (vc-responsible-backend default-directory))
>
> That'd be fine, yes.

But this might be confusing, since this check would not trigger for
non-file buffers generated from those file buffers.

i.e., if you have a buffer with a file name that is not handled by VC,
vc-root-diff would work for that buffer but not for a diff file
generated from that buffer.

Whereas if a buffer with a file name *is* handled by VC, vc-root-diff
would work for both that buffer and a diff file generated for that
buffer.




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

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


Received: (at 6870) by debbugs.gnu.org; 5 Jul 2011 19:04:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 15:04:18 2011
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 1QeAuv-0001Fn-7o
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2011 15:04:17 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1QeAut-0001Fa-Bd
	for 6870 <at> debbugs.gnu.org; Tue, 05 Jul 2011 15:04:15 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av0EAMBfE05FxIxr/2dsb2JhbABTqAl4iHrCUoY2BJ5chCw
X-IronPort-AV: E=Sophos;i="4.65,481,1304308800"; d="scan'208";a="120562692"
Received: from 69-196-140-107.dsl.teksavvy.com (HELO pastel.home)
	([69.196.140.107])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	05 Jul 2011 15:04:09 -0400
Received: by pastel.home (Postfix, from userid 20848)
	id 72154592B2; Tue,  5 Jul 2011 15:04:09 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Lars Magne Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#6870: Make vc-root-diff work in more modes
Message-ID: <jwv1uy43636.fsf-monnier+emacs@HIDDEN>
References: <19561.60443.364109.899857@HIDDEN>
	<m3liwem5v7.fsf@HIDDEN>
	<jwv4o319ar3.fsf-monnier+emacs@HIDDEN>
	<m3vcvgam5m.fsf@HIDDEN>
Date: Tue, 05 Jul 2011 15:04:09 -0400
In-Reply-To: <m3vcvgam5m.fsf@HIDDEN> (Lars Magne Ingebrigtsen's
	message of "Tue, 05 Jul 2011 15:32:05 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 6870
Cc: rogers-emacs@HIDDEN, 6870 <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: -2.1 (--)

>> It's only reasonable in buffers where default-directory is really
>> meaningful.  E.g. in *Help* or *info* it's likely not going to do you
>> much good.
>> So feel free to add more major modes (rather than just `dired'), but
>> I don't think using (vc-responsible-backend default-directory)
>> everywhere is a good idea.

> What about all buffers that have file names?  A la

> (and (buffer-file-name)
>      (vc-responsible-backend default-directory))

That'd be fine, yes.


        Stefan




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

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


Received: (at 6870) by debbugs.gnu.org; 5 Jul 2011 13:37:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 05 09:37:03 2011
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 1Qe5oE-0007By-Ar
	for submit <at> debbugs.gnu.org; Tue, 05 Jul 2011 09:37:03 -0400
Received: from hermes.netfonds.no ([80.91.224.195])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <larsi@HIDDEN>) id 1Qe5oA-0007BM-W6
	for 6870 <at> debbugs.gnu.org; Tue, 05 Jul 2011 09:37:01 -0400
Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]
	helo=quimbies.gnus.org)
	by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.72) (envelope-from <larsi@HIDDEN>)
	id 1Qe5ny-0000Nh-TG; Tue, 05 Jul 2011 15:36:46 +0200
From: Lars Magne Ingebrigtsen <larsi@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#6870: Make vc-root-diff work in more modes
In-Reply-To: <jwv4o319ar3.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
	of "Mon, 04 Jul 2011 14:13:42 -0400")
Date: Tue, 05 Jul 2011 15:32:05 +0200
Message-ID: <m3vcvgam5m.fsf@HIDDEN>
References: <19561.60443.364109.899857@HIDDEN>
	<m3liwem5v7.fsf@HIDDEN>
	<jwv4o319ar3.fsf-monnier+emacs@HIDDEN>
User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)
X-Now-Playing: Joanna Newsom's _Have One On Me (2)_: "Go Long"
X-Hashcash: 1:23:110705:6870 <at> debbugs.gnu.org::I6akTfKe0oLW2H61:00000000000000000000000000000000000000000442I
X-Hashcash: 1:23:110705:rogers-emacs@HIDDEN::UUFOgLdfz0wTR1t+:00000000000000000000000000000000JIQt
X-Hashcash: 1:23:110705:monnier@HIDDEN::xzXzh7VTf9xfEjnn:0000000000000000000000000000000000000Qgfn
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1Qe5ny-0000Nh-TG
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@HIDDEN
MailScanner-NULL-Check: 1310477807.33432@sOFxPKpMSGHvIbqVTqWC/A
X-Spam-Status: No
X-Spam-Score: -2.8 (--)
X-Debbugs-Envelope-To: 6870
Cc: rogers-emacs@HIDDEN, 6870 <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: -2.8 (--)

Stefan Monnier <monnier@HIDDEN> writes:

> It's only reasonable in buffers where default-directory is really
> meaningful.  E.g. in *Help* or *info* it's likely not going to do you
> much good.
> So feel free to add more major modes (rather than just `dired'), but
> I don't think using (vc-responsible-backend default-directory)
> everywhere is a good idea.

What about all buffers that have file names?  A la

(and (buffer-file-name)
     (vc-responsible-backend default-directory))

or something along those lines...
     
-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




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

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


Received: (at 6870) by debbugs.gnu.org; 4 Jul 2011 18:13:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 04 14:13:50 2011
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 1QdneY-00027r-7T
	for submit <at> debbugs.gnu.org; Mon, 04 Jul 2011 14:13:50 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.183]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1QdneW-00027f-Aj
	for 6870 <at> debbugs.gnu.org; Mon, 04 Jul 2011 14:13:49 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av0EABMCEk5FxIxr/2dsb2JhbABTp3t4iHrBE4Y2BJ5chCw
X-IronPort-AV: E=Sophos;i="4.65,474,1304308800"; d="scan'208";a="120402010"
Received: from 69-196-140-107.dsl.teksavvy.com (HELO pastel.home)
	([69.196.140.107])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	04 Jul 2011 14:13:42 -0400
Received: by pastel.home (Postfix, from userid 20848)
	id 556B658DBA; Mon,  4 Jul 2011 14:13:42 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Lars Magne Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#6870: Make vc-root-diff work in more modes
Message-ID: <jwv4o319ar3.fsf-monnier+emacs@HIDDEN>
References: <19561.60443.364109.899857@HIDDEN>
	<m3liwem5v7.fsf@HIDDEN>
Date: Mon, 04 Jul 2011 14:13:42 -0400
In-Reply-To: <m3liwem5v7.fsf@HIDDEN> (Lars Magne Ingebrigtsen's
	message of "Mon, 04 Jul 2011 17:18:36 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 6870
Cc: rogers-emacs@HIDDEN, 6870 <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: -2.1 (--)

>> (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
>> -		 ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
>> -		 (vc-mode (vc-backend buffer-file-name))))
>> +		 (vc-mode (vc-backend buffer-file-name))
>> +		 (t (vc-responsible-backend default-directory))))
>> rootdir working-revision)
>> (unless backend
>> (error "Buffer is not version controlled"))

> This looks very reasonable to me, but I'm not all that familiar with
> vc.el internals.  Does anybody else have any opinions on this?

It's only reasonable in buffers where default-directory is really
meaningful.  E.g. in *Help* or *info* it's likely not going to do you
much good.
So feel free to add more major modes (rather than just `dired'), but
I don't think using (vc-responsible-backend default-directory)
everywhere is a good idea.


        Stefan




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

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


Received: (at 6870) by debbugs.gnu.org; 4 Jul 2011 15:21:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 04 11:21:28 2011
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 1Qdkxk-0003Ke-6G
	for submit <at> debbugs.gnu.org; Mon, 04 Jul 2011 11:21:28 -0400
Received: from hermes.netfonds.no ([80.91.224.195])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <larsi@HIDDEN>) id 1Qdkxh-0003KS-U2
	for 6870 <at> debbugs.gnu.org; Mon, 04 Jul 2011 11:21:26 -0400
Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]
	helo=quimbies.gnus.org)
	by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.72) (envelope-from <larsi@HIDDEN>)
	id 1QdkxW-0005AI-1N; Mon, 04 Jul 2011 17:21:14 +0200
From: Lars Magne Ingebrigtsen <larsi@HIDDEN>
To: rogers-emacs@HIDDEN
Subject: Re: Make vc-root-diff work in more modes
In-Reply-To: <19561.60443.364109.899857@HIDDEN>
	(rogers-emacs@HIDDEN's message of "Mon, 16 Aug 2010 21:55:39
	-0400")
Date: Mon, 04 Jul 2011 17:18:36 +0200
Message-ID: <m3liwem5v7.fsf@HIDDEN>
References: <19561.60443.364109.899857@HIDDEN>
User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)
X-Now-Playing: Joanna Newsom's _Have One On Me (2)_: "Go Long"
X-Hashcash: 1:23:110704:6870 <at> debbugs.gnu.org::0L+/q8rvjhez7RLy:00000000000000000000000000000000000000000CaOo
X-Hashcash: 1:23:110704:rogers-emacs@HIDDEN::1xVWjhwLAXgdKjr6:00000000000000000000000000000000H7zL
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1QdkxW-0005AI-1N
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@HIDDEN
MailScanner-NULL-Check: 1310397674.11033@HPCLCNkrBih87MyaSDbNxQ
X-Spam-Status: No
X-Spam-Score: -2.8 (--)
X-Debbugs-Envelope-To: 6870
Cc: 6870 <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: -2.8 (--)

rogers-emacs@HIDDEN writes:

>    It makes sense to me that vc-root-diff uses "(vc-responsible-backend
> default-directory)" when in a dired-mode buffer.  But since vc-root-diff
> is not at all about the current buffer, why not also make that the
> default for shell-mode, diff-mode, or any of the other modes for
> non-version-controlled buffers that may be generated in a working copy?
>
> 					-- Bob Rogers
> 					   http://www.rgrjr.com/
>
> ------------------------------------------------------------------------
> diff --git a/lisp/vc.el b/lisp/vc.el
> index 1e52a3c..abba202 100644
> --- a/lisp/vc.el
> +++ b/lisp/vc.el
> @@ -1655,8 +1655,8 @@ saving the buffer."
>      (when buffer-file-name (vc-buffer-sync not-urgent))
>      (let ((backend
>  	   (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
> -		 ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
> -		 (vc-mode (vc-backend buffer-file-name))))
> +		 (vc-mode (vc-backend buffer-file-name))
> +		 (t (vc-responsible-backend default-directory))))
>  	  rootdir working-revision)
>        (unless backend
>  	(error "Buffer is not version controlled"))

This looks very reasonable to me, but I'm not all that familiar with
vc.el internals.  Does anybody else have any opinions on this?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




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

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


Received: (at submit) by debbugs.gnu.org; 17 Aug 2010 01:54:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 16 21:54:48 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 1OlBO3-000890-Ug
	for submit <at> debbugs.gnu.org; Mon, 16 Aug 2010 21:54:48 -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 <rogers-emacs@HIDDEN>) id 1OlBO2-00088v-4Y
	for submit <at> debbugs.gnu.org; Mon, 16 Aug 2010 21:54:46 -0400
Received: from lists.gnu.org ([199.232.76.165]:42119)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <rogers-emacs@HIDDEN>) id 1OlBP1-00075V-3d
	for submit <at> debbugs.gnu.org; Mon, 16 Aug 2010 21:55:47 -0400
Received: from [140.186.70.92] (port=55140 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1OlBOy-0004lP-MN
	for bug-gnu-emacs@HIDDEN; Mon, 16 Aug 2010 21:55:46 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00
	autolearn=unavailable version=3.3.1
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <rogers-emacs@HIDDEN>) id 1OlBOx-0002nt-5C
	for bug-gnu-emacs@HIDDEN; Mon, 16 Aug 2010 21:55:44 -0400
Received: from rgrjr.com ([216.146.47.5]:44741)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <rogers-emacs@HIDDEN>) id 1OlBOx-0002nT-2x
	for bug-gnu-emacs@HIDDEN; Mon, 16 Aug 2010 21:55:43 -0400
Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net
	[66.30.196.77])
	by rgrjr.com (Postfix on CentOS) with ESMTP id 1DDB61601B9
	for <bug-gnu-emacs@HIDDEN>; Tue, 17 Aug 2010 01:55:41 +0000 (UTC)
Received: (qmail 28243 invoked by uid 89); 17 Aug 2010 01:55:40 -0000
Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1)
	by home with SMTP; 17 Aug 2010 01:55:40 -0000
Received: by rgr.rgrjr.com (Postfix, from userid 500)
	id D199B484F0; Mon, 16 Aug 2010 21:55:39 -0400 (EDT)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <19561.60443.364109.899857@HIDDEN>
Date: Mon, 16 Aug 2010 21:55:39 -0400
From: rogers-emacs@HIDDEN
To: bug-gnu-emacs@HIDDEN
Subject: Make vc-root-diff work in more modes
X-Mailer: VM viewmail-600 under 24.0.50.1 (i686-pc-linux-gnu)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -5.7 (-----)
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.8 (-----)

   It makes sense to me that vc-root-diff uses "(vc-responsible-backend
default-directory)" when in a dired-mode buffer.  But since vc-root-diff
is not at all about the current buffer, why not also make that the
default for shell-mode, diff-mode, or any of the other modes for
non-version-controlled buffers that may be generated in a working copy?

					-- Bob Rogers
					   http://www.rgrjr.com/

------------------------------------------------------------------------
diff --git a/lisp/vc.el b/lisp/vc.el
index 1e52a3c..abba202 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1655,8 +1655,8 @@ saving the buffer."
     (when buffer-file-name (vc-buffer-sync not-urgent))
     (let ((backend
 	   (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
-		 ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
-		 (vc-mode (vc-backend buffer-file-name))))
+		 (vc-mode (vc-backend buffer-file-name))
+		 (t (vc-responsible-backend default-directory))))
 	  rootdir working-revision)
       (unless backend
 	(error "Buffer is not version controlled"))




Acknowledgement sent to rogers-emacs@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#6870; 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.