From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.bugs Subject: bug#7350: 24.0.50; make vc-deduce-backend smarter Date: Mon, 8 Nov 2010 16:05:43 -0500 Message-ID: <19672.26151.150217.308712@rgr.rgrjr.com> References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1289252746 3637 80.91.229.12 (8 Nov 2010 21:45:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 8 Nov 2010 21:45:46 +0000 (UTC) Cc: 7350@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 08 22:45:40 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PFZWs-00013t-6u for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Nov 2010 22:45:31 +0100 Original-Received: from localhost ([127.0.0.1]:38538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFZWr-0006CV-9C for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Nov 2010 16:45:29 -0500 Original-Received: from [140.186.70.92] (port=38503 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFZNI-0007El-8D for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2010 16:35:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFZ2C-0001mR-3f for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2010 16:13:49 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFZ2C-0001mN-1q for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2010 16:13:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PFYuf-0008UX-VE; Mon, 08 Nov 2010 16:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bob Rogers Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Nov 2010 21:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7350 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7350-submit@debbugs.gnu.org id=B7350.128925034632635 (code B ref 7350); Mon, 08 Nov 2010 21:06:01 +0000 Original-Received: (at 7350) by debbugs.gnu.org; 8 Nov 2010 21:05:46 +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 1PFYuQ-0008UK-11 for submit@debbugs.gnu.org; Mon, 08 Nov 2010 16:05:46 -0500 Original-Received: from rgrjr.com ([216.146.47.5]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PFYpu-0008SJ-R0 for 7350@debbugs.gnu.org; Mon, 08 Nov 2010 16:01:07 -0500 Original-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 3F76F1601D7 for <7350@debbugs.gnu.org>; Mon, 8 Nov 2010 21:05:44 +0000 (UTC) Original-Received: (qmail 15521 invoked by uid 89); 8 Nov 2010 21:05:43 -0000 Original-Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 8 Nov 2010 21:05:43 -0000 Original-Received: by rgr.rgrjr.com (Postfix, from userid 500) id 84053A4E6E; Mon, 8 Nov 2010 16:05:43 -0500 (EST) In-Reply-To: X-Mailer: VM 7.19 under Emacs 24.0.50.1 X-Mailman-Approved-At: Mon, 08 Nov 2010 16:05:44 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 08 Nov 2010 16:06:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:41444 Archived-At: From: Stefan Monnier Date: Mon, 08 Nov 2010 12:47:49 -0500 > Could you give an example use-case where you'd want vc-deduce-backend to > be run in a shell-mode buffer? > I have gotten into the habit of using a shell buffer to disambiguate > which repo I want to use for general VC commands like vc-root-diff and > vc-dir. Hmm... I use a VC-Dir buffer for that ;-) Me too -- when I'm already there. But if not, as I've said, it's usually faster for me to go through the shell buffer. Besides, it also avoids the annoying (and often unneeded) refresh from re-invoking vc-dir. > Since I bind "shell" to f8, it is often faster to type "f8 C-x > v d RET" than to supply an explicit pathname to vc-dir. (I'm often in > the right shell buffer already, having just typed "make test".) I don't follow: if you're already in the right shell buffer, then f8 won't do anything. Yes, and that saves me a keystroke. The point being that I frequently find myself doing VC commands from the shell buffer anyway. > Since vc-root-diff doesn't take a pathname arg, I have to do something > explicit to get into the right tree anyway. So it makes sense to me > that vc-root-diff should work like vc-dir in a non-VC buffer. > There is already an exception for dired-mode; why not generalize? It can definitely be generalized, but I'd rather stick to buffers where there's a clear association with a particular file or directory. E.g. *Help* buffers aren't good candidates. Fair enough. Seems odd that default-directory is not nil for these. shell-mode doesn't sound like a bad candidate, actually. The only problem I see with it is that a shell buffer's default-directory is easily out-of-sync with the underlying process's own notion of cwd. In my experience, it's not too bad. I do find myself using shell-resync-dirs now and then, but it's almost always after exiting a subshell, and I've trained myself to resync when needed. (Maybe the shell-dirtrack thing should resync automatically when it sees "exit"?) Does the patch below solve your immediate problem? Works for me. It doesn't cover the cases where I'm looking at a generated file, or test output, but (in my workflow anyway) those cases are rarer. > In fact, this is something of a regression from Emacs 22.x, where > "C-u C-x v = . RET RET RET" would do the equivalent of > (vc-version-diff (expand-file-name ".") nil nil) > which is nearly vc-root-diff, regardless of buffer mode. This no longer > works in the brave new world of filesets, This was the result of a trade-off (get rid of one RET since it's almost never used). But I guess we could/should prompt the user for a file/dir rather than signal "File is not under version control" or some such error. Stefan That would be much nicer, especially since the underlying functionality (i.e. support for vc-diff of directories) still works. -- Bob P.S. I mailed the signed copyright assignment today, so FSF should have it tomorrow.