From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#6870: Make vc-root-diff work in more modes Date: Mon, 04 Jul 2011 17:18:36 +0200 Message-ID: References: <19561.60443.364109.899857@rgr.rgrjr.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1309794422 9638 80.91.229.12 (4 Jul 2011 15:47:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2011 15:47:02 +0000 (UTC) Cc: 6870@debbugs.gnu.org To: rogers-emacs@rgrjr.dyndns.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 04 17:46:57 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QdlMP-0001KN-Id for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Jul 2011 17:46:57 +0200 Original-Received: from localhost ([::1]:48707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdlMO-0008Uu-AP for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Jul 2011 11:46:56 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:55377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdkyK-0001yq-OE for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 11:22:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdkyI-00087j-NK for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 11:22:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdkyI-00087e-BW for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 11:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QdkyH-0003LU-O7; Mon, 04 Jul 2011 11:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Magne Ingebrigtsen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Jul 2011 15:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6870 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6870-submit@debbugs.gnu.org id=B6870.130979288812815 (code B ref 6870); Mon, 04 Jul 2011 15:22:01 +0000 Original-Received: (at 6870) by debbugs.gnu.org; 4 Jul 2011 15:21:28 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qdkxk-0003Ke-6G for submit@debbugs.gnu.org; Mon, 04 Jul 2011 11:21:28 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qdkxh-0003KS-U2 for 6870@debbugs.gnu.org; Mon, 04 Jul 2011 11:21:26 -0400 Original-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 ) id 1QdkxW-0005AI-1N; Mon, 04 Jul 2011 17:21:14 +0200 In-Reply-To: <19561.60443.364109.899857@rgr.rgrjr.com> (rogers-emacs@rgrjr.dyndns.org's message of "Mon, 16 Aug 2010 21:55:39 -0400") 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@debbugs.gnu.org::0L+/q8rvjhez7RLy:00000000000000000000000000000000000000000CaOo X-Hashcash: 1:23:110704:rogers-emacs@rgrjr.dyndns.org::1xVWjhwLAXgdKjr6:00000000000000000000000000000000H7zL X-MailScanner-ID: 1QdkxW-0005AI-1N MailScanner-NULL-Check: 1310397674.11033@HPCLCNkrBih87MyaSDbNxQ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 04 Jul 2011 11:22:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47951 Archived-At: rogers-emacs@rgrjr.dyndns.org 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/