From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 06 18:16:21 2010 Received: (at submit) by debbugs.gnu.org; 6 Nov 2010 22:16:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PEr3c-0003zG-DX for submit@debbugs.gnu.org; Sat, 06 Nov 2010 18:16:21 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PEr14-0003xk-7Z for submit@debbugs.gnu.org; Sat, 06 Nov 2010 18:13:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PEr5T-0003zI-6B for submit@debbugs.gnu.org; Sat, 06 Nov 2010 18:18:16 -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 lists.gnu.org ([199.232.76.165]:42531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PEr5T-0003zD-47 for submit@debbugs.gnu.org; Sat, 06 Nov 2010 18:18:15 -0400 Received: from [140.186.70.92] (port=49330 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PEr5Q-0003lx-PO for bug-gnu-emacs@gnu.org; Sat, 06 Nov 2010 18:18:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PEr5P-0003xu-Kj for bug-gnu-emacs@gnu.org; Sat, 06 Nov 2010 18:18:12 -0400 Received: from rgrjr.com ([216.146.47.5]:53719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PEr5P-0003xj-Hv for bug-gnu-emacs@gnu.org; Sat, 06 Nov 2010 18:18:11 -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 CCE3A160125 for ; Sat, 6 Nov 2010 22:18:09 +0000 (UTC) Received: (qmail 29985 invoked by uid 89); 6 Nov 2010 22:18:09 -0000 Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 6 Nov 2010 22:18:09 -0000 Received: by rgr.rgrjr.com (Postfix, from userid 500) id 3D937A4E03; Sat, 6 Nov 2010 18:18:09 -0400 (EDT) From: Bob Rogers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19669.54304.980911.220632@rgr.rgrjr.com> Date: Sat, 6 Nov 2010 18:18:08 -0400 To: bug-gnu-emacs@gnu.org Subject: 24.0.50; make vc-deduce-backend smarter X-Mailer: VM 7.19 under Emacs 24.0.50.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 06 Nov 2010 18:16:19 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) I notice that vc-root-diff only works if the current buffer is visiting a version-controlled file, and in certain other buffer modes. In particular, it works in dired-mode, where it uses the default-directory, but not in shell-mode, which is not one of the explicit special cases. ISTM that using default-directory would make a better default case, since that ought to DTRT in the majority of cases. Indeed, one might be able to get rid of some of the other vc-deduce-backend cases, since most such modes seem to need to set up the right default-directory anyway. -- Bob Rogers http://www.rgrjr.com/ ------------------------------------------------------------------------ diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 665dafb..ddeb546 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -920,9 +920,9 @@ Within directories, only files already under version control are noticed." (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) ((derived-mode-p 'log-view-mode) log-view-vc-backend) ((derived-mode-p 'diff-mode) diff-vc-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)) + (default-directory + (vc-responsible-backend default-directory)))) (declare-function vc-dir-current-file "vc-dir" ()) (declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files)) From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 07 14:58:42 2010 Received: (at 7350) by debbugs.gnu.org; 7 Nov 2010 19:58:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PFBNy-0005LW-JU for submit@debbugs.gnu.org; Sun, 07 Nov 2010 14:58:42 -0500 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 ) id 1PFBNx-0005LR-7O for 7350@debbugs.gnu.org; Sun, 07 Nov 2010 14:58:41 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoEKAP+U1kxMCpqE/2dsb2JhbAChCX9yuEaFSASEWI1a X-IronPort-AV: E=Sophos;i="4.58,310,1286164800"; d="scan'208";a="81870741" Received: from 76-10-154-132.dsl.teksavvy.com (HELO pastel.home) ([76.10.154.132]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 07 Nov 2010 15:03:17 -0500 Received: by pastel.home (Postfix, from userid 20848) id 73475A86CC; Sun, 7 Nov 2010 15:03:16 -0500 (EST) From: Stefan Monnier To: Bob Rogers Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter Message-ID: References: <19669.54304.980911.220632@rgr.rgrjr.com> Date: Sun, 07 Nov 2010 15:03:16 -0500 In-Reply-To: <19669.54304.980911.220632@rgr.rgrjr.com> (Bob Rogers's message of "Sat, 6 Nov 2010 18:18:08 -0400") 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: 7350 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > I notice that vc-root-diff only works if the current buffer is > visiting a version-controlled file, and in certain other buffer modes. > In particular, it works in dired-mode, where it uses the > default-directory, but not in shell-mode, which is not one of the > explicit special cases. Could you give an example use-case where you'd want vc-deduce-backend to be run in a shell-mode buffer? Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 07 16:53:54 2010 Received: (at 7350) by debbugs.gnu.org; 7 Nov 2010 21:53:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PFDBR-00065S-TW for submit@debbugs.gnu.org; Sun, 07 Nov 2010 16:53:54 -0500 Received: from rgrjr.com ([216.146.47.5]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PFCug-0005z0-6M for 7350@debbugs.gnu.org; Sun, 07 Nov 2010 16:36:35 -0500 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 CABD0160109 for <7350@debbugs.gnu.org>; Sun, 7 Nov 2010 21:41:09 +0000 (UTC) Received: (qmail 3421 invoked by uid 89); 7 Nov 2010 21:41:09 -0000 Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 7 Nov 2010 21:41:09 -0000 Received: by rgr.rgrjr.com (Postfix, from userid 500) id EFE73A4E03; Sun, 7 Nov 2010 16:41:08 -0500 (EST) From: Bob Rogers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19671.7412.608640.593137@rgr.rgrjr.com> Date: Sun, 7 Nov 2010 16:41:08 -0500 To: Stefan Monnier Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter In-Reply-To: References: <19669.54304.980911.220632@rgr.rgrjr.com> X-Mailer: VM 7.19 under Emacs 24.0.50.1 X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: 7350 X-Mailman-Approved-At: Sun, 07 Nov 2010 16:53:52 -0500 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.9 (---) From: Stefan Monnier Date: Sun, 07 Nov 2010 15:03:16 -0500 > I notice that vc-root-diff only works if the current buffer is > visiting a version-controlled file, and in certain other buffer modes. > In particular, it works in dired-mode, where it uses the > default-directory, but not in shell-mode, which is not one of the > explicit special cases. Could you give an example use-case where you'd want vc-deduce-backend to be run in a shell-mode buffer? Stefan 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. 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".) 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? 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, so I had to revise my shorthand command to turn "." into a fileset. I was hoping that vc-root-diff (which I only stumbled over recently) would serve as a replacement, but it doesn't quite match my workflow because of this insistence on being in a VC buffer. As an aside, I often think that VC doesn't have a good enough notion of "current file set;" there are other times when it doesn't seem to DTRT. (Except for the change in vc-diff mentioned in the previous paragraph, I can't recall any examples off the top of my head). But so far I haven't had any ideas. In short, I don't have a killer use case -- I could just keep on using my own command for this -- but on the other hand, I don't see the need for limiting commands like vc-root-diff in this way. If you think that this is the wrong place to make this change, then the alternative patch below makes the same change to vc-root-diff directly. (And I'll let you know if I find any better use cases. ;-) -- Bob ------------------------------------------------------------------------ diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 665dafb..5c7fa81 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1682,7 +1682,9 @@ saving the buffer." ;; that's not what we want here, we want the diff for the VC root dir. (call-interactively 'vc-version-diff) (when buffer-file-name (vc-buffer-sync not-urgent)) - (let ((backend (vc-deduce-backend)) + (let ((backend (or (vc-deduce-backend) + (and default-directory + (vc-responsible-backend default-directory)))) rootdir working-revision) (unless backend (error "Buffer is not version controlled")) From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 08 12:43:14 2010 Received: (at 7350) by debbugs.gnu.org; 8 Nov 2010 17:43:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PFVkP-0006vi-TY for submit@debbugs.gnu.org; Mon, 08 Nov 2010 12:43:14 -0500 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 ) id 1PFVkN-0006vd-Ns for 7350@debbugs.gnu.org; Mon, 08 Nov 2010 12:43:12 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtEKANvG10xMCpqE/2dsb2JhbAChCIECcr1NhUgEhFiNWg X-IronPort-AV: E=Sophos;i="4.58,314,1286164800"; d="scan'208";a="81940185" Received: from 76-10-154-132.dsl.teksavvy.com (HELO pastel.home) ([76.10.154.132]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 08 Nov 2010 12:47:50 -0500 Received: by pastel.home (Postfix, from userid 20848) id 93432A86D8; Mon, 8 Nov 2010 12:47:49 -0500 (EST) From: Stefan Monnier To: Bob Rogers Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter Message-ID: References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> Date: Mon, 08 Nov 2010 12:47:49 -0500 In-Reply-To: <19671.7412.608640.593137@rgr.rgrjr.com> (Bob Rogers's message of "Sun, 7 Nov 2010 16:41:08 -0500") 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: 7350 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) >> I notice that vc-root-diff only works if the current buffer is >> visiting a version-controlled file, and in certain other buffer modes. >> In particular, it works in dired-mode, where it uses the >> default-directory, but not in shell-mode, which is not one of the >> explicit special cases. > 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 ;-) > 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. > 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. 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. Does the patch below solve your immediate problem? > 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 === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2010-10-05 18:47:39 +0000 +++ lisp/vc/vc.el 2010-11-08 16:18:04 +0000 @@ -921,7 +921,7 @@ (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) ((derived-mode-p 'log-view-mode) log-view-vc-backend) ((derived-mode-p 'diff-mode) diff-vc-backend) - ((derived-mode-p 'dired-mode) + ((derived-mode-p 'dired-mode 'shell-mode) (vc-responsible-backend default-directory)) (vc-mode (vc-backend buffer-file-name)))) From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 08 16:05:46 2010 Received: (at 7350) by debbugs.gnu.org; 8 Nov 2010 21:05:46 +0000 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 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 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) Received: (qmail 15521 invoked by uid 89); 8 Nov 2010 21:05:43 -0000 Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 8 Nov 2010 21:05:43 -0000 Received: by rgr.rgrjr.com (Postfix, from userid 500) id 84053A4E6E; Mon, 8 Nov 2010 16:05:43 -0500 (EST) From: Bob Rogers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19672.26151.150217.308712@rgr.rgrjr.com> Date: Mon, 8 Nov 2010 16:05:43 -0500 To: Stefan Monnier Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter In-Reply-To: References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> X-Mailer: VM 7.19 under Emacs 24.0.50.1 X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 7350 X-Mailman-Approved-At: Mon, 08 Nov 2010 16:05:44 -0500 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 12 08:43:44 2010 Received: (at 7350) by debbugs.gnu.org; 12 Nov 2010 13:43:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PGtuq-0005PM-5h for submit@debbugs.gnu.org; Fri, 12 Nov 2010 08:43:44 -0500 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 ) id 1PGtuo-0005PG-L2 for 7350@debbugs.gnu.org; Fri, 12 Nov 2010 08:43:43 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnAGAJrU3ExMCpqE/2dsb2JhbAChV3lyvj6FSgSEWo1f X-IronPort-AV: E=Sophos;i="4.59,188,1288584000"; d="scan'208";a="82331635" Received: from 76-10-154-132.dsl.teksavvy.com (HELO pastel.home) ([76.10.154.132]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 12 Nov 2010 08:48:30 -0500 Received: by pastel.home (Postfix, from userid 20848) id 6BE1CA86F8; Fri, 12 Nov 2010 08:48:30 -0500 (EST) From: Stefan Monnier To: Bob Rogers Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter Message-ID: References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> <19672.26151.150217.308712@rgr.rgrjr.com> Date: Fri, 12 Nov 2010 08:48:30 -0500 In-Reply-To: <19672.26151.150217.308712@rgr.rgrjr.com> (Bob Rogers's message of "Mon, 8 Nov 2010 16:05:43 -0500") 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: 7350 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > 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. There are all kinds of reasons why we don't like default-directory to be nil. > 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. I've installed the patch into the trunk (i.e. not for Emacs-23.3 but Emacs-24) and added compilation-mode to shell-mode, since it's also clearly linked to a particular location in the file-system. > 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. > That would be much nicer, especially since the underlying functionality > (i.e. support for vc-diff of directories) still works. Patch welcome. > P.S. I mailed the signed copyright assignment today, so FSF should have > it tomorrow. Great (tho, OT1H I can't remember for which patch this is, and OTOH the FSF itself usually takes a little while to process those mail). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 14 18:16:43 2010 Received: (at 7350) by debbugs.gnu.org; 14 Nov 2010 23:16:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PHloR-0001oW-1g for submit@debbugs.gnu.org; Sun, 14 Nov 2010 18:16:43 -0500 Received: from rgrjr.com ([216.146.47.5]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PHloP-0001oR-Mz for 7350@debbugs.gnu.org; Sun, 14 Nov 2010 18:16:42 -0500 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 87822160160 for <7350@debbugs.gnu.org>; Sun, 14 Nov 2010 23:21:35 +0000 (UTC) Received: (qmail 11807 invoked by uid 89); 14 Nov 2010 23:21:35 -0000 Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 14 Nov 2010 23:21:35 -0000 Received: by rgr.rgrjr.com (Postfix, from userid 500) id A97D0A4E6E; Sun, 14 Nov 2010 18:21:34 -0500 (EST) From: Bob Rogers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19680.28414.314610.707478@rgr.rgrjr.com> Date: Sun, 14 Nov 2010 18:21:34 -0500 To: Stefan Monnier Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter In-Reply-To: References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> <19672.26151.150217.308712@rgr.rgrjr.com> X-Mailer: VM 7.19 under Emacs 24.0.50.1 X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 7350 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) From: Stefan Monnier Date: Fri, 12 Nov 2010 08:48:30 -0500 > 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. There are all kinds of reasons why we don't like default-directory to be nil. > 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. I've installed the patch into the trunk (i.e. not for Emacs-23.3 but Emacs-24) and added compilation-mode to shell-mode, since it's also clearly linked to a particular location in the file-system. Great; thank you. > 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. > That would be much nicer, especially since the underlying functionality > (i.e. support for vc-diff of directories) still works. Patch welcome. Hmm. TRT would be to figure this out in the "interactive" form, so that repeat-complex-command works, but that would change the args to vc-diff. How big a change are you willing to contemplate? > P.S. I mailed the signed copyright assignment today, so FSF should > have it tomorrow. Great (tho, OT1H I can't remember for which patch this is, and OTOH the FSF itself usually takes a little while to process those mail). Stefan NP; it was on my mind, so I just thought I'd mention it. -- Bob From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 11:00:18 2010 Received: (at 7350) by debbugs.gnu.org; 15 Nov 2010 16:00:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PI1Td-0000ZV-TM for submit@debbugs.gnu.org; Mon, 15 Nov 2010 11:00:18 -0500 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 ) id 1PI1Tb-0000ZQ-BT for 7350@debbugs.gnu.org; Mon, 15 Nov 2010 11:00:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0GAL/o4ExFpY76/2dsb2JhbAChWX5yviaDBAiCPgSEWo1f X-IronPort-AV: E=Sophos;i="4.59,200,1288584000"; d="scan'208";a="82587925" Received: from 69-165-142-250.dsl.teksavvy.com (HELO pastel.home) ([69.165.142.250]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 15 Nov 2010 11:05:11 -0500 Received: by pastel.home (Postfix, from userid 20848) id 7060EA8263; Mon, 15 Nov 2010 11:05:11 -0500 (EST) From: Stefan Monnier To: Bob Rogers Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter Message-ID: References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> <19672.26151.150217.308712@rgr.rgrjr.com> <19680.28414.314610.707478@rgr.rgrjr.com> Date: Mon, 15 Nov 2010 11:05:11 -0500 In-Reply-To: <19680.28414.314610.707478@rgr.rgrjr.com> (Bob Rogers's message of "Sun, 14 Nov 2010 18:21:34 -0500") 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: 7350 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > Hmm. TRT would be to figure this out in the "interactive" form, so that > repeat-complex-command works, but that would change the args to vc-diff. > How big a change are you willing to contemplate? A largish patch is not a problem in and of itself (except for copyright reasons, but once you've signed the paperwork it's a non-issue). So the only reason to reject such a change would be if it made the code conceptually more tricky/complex. From the sound of it, it would make it actually more regular, more in line with the usual way commands work in Emacs, so it seems OK. Of course, there is also the risk of introducing bugs/incompatibilities, so try and make extra sure you take into account all callers. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 16 23:38:52 2010 Received: (at 7350) by debbugs.gnu.org; 17 Nov 2010 04:38:53 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PIZnH-0002UK-Mv for submit@debbugs.gnu.org; Tue, 16 Nov 2010 23:38:52 -0500 Received: from rgrjr.com ([216.146.47.5]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PIZnF-0002UF-By for 7350@debbugs.gnu.org; Tue, 16 Nov 2010 23:38:50 -0500 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 BFE5F16018D for <7350@debbugs.gnu.org>; Wed, 17 Nov 2010 04:43:49 +0000 (UTC) Received: (qmail 12650 invoked by uid 89); 17 Nov 2010 04:43:49 -0000 Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 17 Nov 2010 04:43:49 -0000 Received: by rgr.rgrjr.com (Postfix, from userid 500) id 7CD0AA4E6E; Tue, 16 Nov 2010 23:43:48 -0500 (EST) From: Bob Rogers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19683.23940.23038.507387@rgr.rgrjr.com> Date: Tue, 16 Nov 2010 23:43:48 -0500 To: Stefan Monnier Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter In-Reply-To: References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> <19672.26151.150217.308712@rgr.rgrjr.com> <19680.28414.314610.707478@rgr.rgrjr.com> X-Mailer: VM 7.19 under Emacs 24.0.50.1 X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 7350 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) From: Stefan Monnier Date: Mon, 15 Nov 2010 11:05:11 -0500 > Hmm. TRT would be to figure this out in the "interactive" form, so that > repeat-complex-command works, but that would change the args to vc-diff. > How big a change are you willing to contemplate? A largish patch is not a problem in and of itself (except for copyright reasons, but once you've signed the paperwork it's a non-issue). So the only reason to reject such a change would be if it made the code conceptually more tricky/complex. From the sound of it, it would make it actually more regular, more in line with the usual way commands work in Emacs, so it seems OK. The problem, of course, is knowing when to stop. ;-} vc-diff calls vc-version-diff, which should also be changed to accept a fileset, but that's tricky because it's called via call-interactively . . . Anyway, I've appended a work-in-progress patch, FYI. It depends on refactoring vc-deduce-fileset, which in turn depends on the assumption that vc-parent-buffer must be registered. Comments welcomed. Of course, there is also the risk of introducing bugs/incompatibilities, so try and make extra sure you take into account all callers. Stefan Grepping found only one caller; vc-log-edit passes it as the log-edit-diff-function. But this really ought to use the passed fileset, and not go through the command again, true? -- Bob ------------------------------------------------------------------------ diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 665dafb..0681ed3 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -927,31 +927,20 @@ Within directories, only files already under version control are noticed." (declare-function vc-dir-current-file "vc-dir" ()) (declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files)) -(defun vc-deduce-fileset (&optional observer allow-unregistered - state-model-only-files) - "Deduce a set of files and a backend to which to apply an operation. +(defun vc-deduce-fileset-internal (&optional nonviolent-p state-model-only-files) + "Deduce a set of registered files and a backend for an operation. Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL). -If we're in VC-dir mode, the fileset is the list of marked files. -Otherwise, if we're looking at a buffer visiting a version-controlled file, -the fileset is a singleton containing this file. -If none of these conditions is met, but ALLOW_UNREGISTERED is on and the -visited file is not registered, return a singleton fileset containing it. -Otherwise, throw an error. +See vc-deduce-fileset for details; we do just the first part of the search, +looking for registered files, returning nil if nothing found. -STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs -the FILESET-ONLY-FILES STATE and MODEL info. Otherwise, that -part may be skipped. -BEWARE: this function may change the -current buffer." - ;; FIXME: OBSERVER is unused. The name is not intuitive and is not - ;; documented. It's set to t when called from diff and print-log. +BEWARE: this function may change the current buffer." (let (backend) (cond ((derived-mode-p 'vc-dir-mode) (vc-dir-deduce-fileset state-model-only-files)) ((derived-mode-p 'dired-mode) - (if observer + (if nonviolent-p (vc-dired-deduce-fileset) (error "State changing VC operations not supported in `dired-mode'"))) ((setq backend (vc-backend buffer-file-name)) @@ -964,11 +953,37 @@ current buffer." ((and (buffer-live-p vc-parent-buffer) ;; FIXME: Why this test? --Stef (or (buffer-file-name vc-parent-buffer) - (with-current-buffer vc-parent-buffer - (derived-mode-p 'vc-dir-mode)))) + (with-current-buffer vc-parent-buffer + (derived-mode-p 'vc-dir-mode)))) + ;; Note that vc-parent-buffer must be registered. (progn ;FIXME: Why not `with-current-buffer'? --Stef. (set-buffer vc-parent-buffer) - (vc-deduce-fileset observer allow-unregistered state-model-only-files))) + (vc-deduce-fileset-internal nonviolent-p state-model-only-files)))))) + +(defun vc-deduce-fileset (&optional nonviolent-p allow-unregistered + state-model-only-files) + "Deduce a set of files and a backend to which to apply an operation. + +Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL). +If we're in VC-dir mode, the fileset is the list of marked files. +Otherwise, if we're in dired-mode, use current/marked files. +Otherwise, if we're looking at a buffer visiting a version-controlled file, +the fileset is a singleton containing this file. +Otherwise, if we're in a VC buffer that has a parent, try again in the parent. +If none of these conditions is met, but ALLOW-UNREGISTERED is true and the +visited file is not registered, return a singleton fileset containing it. +Otherwise, throw an error. + +NONVIOLENT-P means that the fileset will be used for a non-state-changing +operation, such as vc-log or vc-diff. + +STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs +the FILESET-ONLY-FILES STATE and MODEL info. Otherwise, that +part may be skipped. +BEWARE: this function may change the +current buffer." + (cond + ((vc-deduce-fileset-internal nonviolent-p state-model-only-files)) ((not buffer-file-name) (error "Buffer %s is not associated with a file" (buffer-name))) ((and allow-unregistered (not (vc-registered buffer-file-name))) @@ -980,7 +995,7 @@ current buffer." nil) (list (vc-backend-for-registration (buffer-file-name)) (list buffer-file-name)))) - (t (error "No fileset is available here"))))) + (t (error "No fileset is available here")))) (defun vc-dired-deduce-fileset () (let ((backend (vc-responsible-backend default-directory))) @@ -1650,7 +1665,7 @@ returns t if the buffer had changes, nil otherwise." (called-interactively-p 'interactive))) ;;;###autoload -(defun vc-diff (historic &optional not-urgent) +(defun vc-diff (historic &optional fileset not-urgent) "Display diffs between file revisions. Normally this compares the currently selected fileset with their working revisions. With a prefix argument HISTORIC, it reads two revision @@ -1658,11 +1673,24 @@ designators specifying which revisions to compare. The optional argument NOT-URGENT non-nil means it is ok to say no to saving the buffer." - (interactive (list current-prefix-arg t)) + (interactive + (list current-prefix-arg + (if current-prefix-arg + nil + (or (vc-deduce-fileset-internal t) + (let ((file (read-file-name "VC diff file: " + default-directory + default-directory))) + (list (or (vc-responsible-backend file) + (error "%S is not under version control." file)) + (list (file-truename file)))))) + 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 + (when buffer-file-name + ;; [there should be a vc-fileset-sync instead. -- rgr, 16-Nov-10.] + (vc-buffer-sync not-urgent)) + (vc-diff-internal t fileset nil nil (called-interactively-p 'interactive)))) ;;;###autoload From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 18 14:51:24 2010 Received: (at 7350) by debbugs.gnu.org; 18 Nov 2010 19:51:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJAVw-0006WZ-91 for submit@debbugs.gnu.org; Thu, 18 Nov 2010 14:51:24 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJAVv-0006WC-9i for 7350@debbugs.gnu.org; Thu, 18 Nov 2010 14:51:23 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id oAIJuPAH006672; Thu, 18 Nov 2010 14:56:27 -0500 Received: by pastel.home (Postfix, from userid 20848) id 10F3FA82B4; Wed, 17 Nov 2010 08:31:26 -0500 (EST) From: Stefan Monnier To: Bob Rogers Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter Message-ID: References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> <19672.26151.150217.308712@rgr.rgrjr.com> <19680.28414.314610.707478@rgr.rgrjr.com> <19683.23940.23038.507387@rgr.rgrjr.com> Date: Wed, 17 Nov 2010 08:31:26 -0500 In-Reply-To: <19683.23940.23038.507387@rgr.rgrjr.com> (Bob Rogers's message of "Tue, 16 Nov 2010 23:43:48 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3683=0 X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 7350 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.3 (-) > A largish patch is not a problem in and of itself (except for copyright > reasons, but once you've signed the paperwork it's a non-issue). So the > only reason to reject such a change would be if it made the code > conceptually more tricky/complex. From the sound of it, it would make > it actually more regular, more in line with the usual way commands work > in Emacs, so it seems OK. > The problem, of course, is knowing when to stop. ;-} For having looked at this particular part of the code with similar intentions a few years ago, I know. > Anyway, I've appended a work-in-progress patch, FYI. It depends on > refactoring vc-deduce-fileset, which in turn depends on the assumption > that vc-parent-buffer must be registered. Comments welcomed. Thanks for the work-in-progress. Comments will follow. > Grepping found only one caller; vc-log-edit passes it as the > log-edit-diff-function. But this really ought to use the passed > fileset, and not go through the command again, true? Actually, what it *should* do is select the same fileset as the one that C-c C-c will commit. I'm not sure which fileset is chosen by C-c C-c, but if I were to choose, I'd follow the PCL-CVS behavior which is to recompute the fileset rather than use whatever was the fileset when the *VC-Log* buffer was created (but aditionally check whether the new fileset is the same as the old one, and if not prompt the user to make sure that's really what she intended). Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 18 21:22:32 2010 Received: (at 7350) by debbugs.gnu.org; 19 Nov 2010 02:22:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJGcR-0000gP-Va for submit@debbugs.gnu.org; Thu, 18 Nov 2010 21:22:32 -0500 Received: from rgrjr.com ([216.146.47.5]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJGcB-0000gK-KP for 7350@debbugs.gnu.org; Thu, 18 Nov 2010 21:22:30 -0500 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 1802A160169 for <7350@debbugs.gnu.org>; Fri, 19 Nov 2010 02:27:21 +0000 (UTC) Received: (qmail 26249 invoked by uid 89); 19 Nov 2010 02:27:20 -0000 Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 19 Nov 2010 02:27:20 -0000 Received: by rgr.rgrjr.com (Postfix, from userid 500) id E80A1A4E6E; Thu, 18 Nov 2010 21:27:19 -0500 (EST) From: Bob Rogers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19685.57479.436724.154495@rgr.rgrjr.com> Date: Thu, 18 Nov 2010 21:27:19 -0500 To: Stefan Monnier Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter In-Reply-To: References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> <19672.26151.150217.308712@rgr.rgrjr.com> <19680.28414.314610.707478@rgr.rgrjr.com> <19683.23940.23038.507387@rgr.rgrjr.com> X-Mailer: VM 7.19 under Emacs 24.0.50.1 X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 7350 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) From: Stefan Monnier Date: Wed, 17 Nov 2010 08:31:26 -0500 > Grepping found only one caller; vc-log-edit passes it as the > log-edit-diff-function. But this really ought to use the passed > fileset, and not go through the command again, true? Actually, what it *should* do is select the same fileset as the one that C-c C-c will commit. Yes, exactly. I'm not sure which fileset is chosen by C-c C-c, but if I were to choose, I'd follow the PCL-CVS behavior which is to recompute the fileset rather than use whatever was the fileset when the *VC-Log* buffer was created . . . The fileset is not recomputed; if you change the fileset in *vc-dir*, you must do vc-next-action explicitly to update the log buffer fileset. That threw me for a loop when I first used it, but now that I've gotten used to it, I can see the utility of it. (but aditionally check whether the new fileset is the same as the old one, and if not prompt the user to make sure that's really what she intended). Stefan Sounds like a clear win, since it removes the confusingness while continuing to allow both behaviors. Accordingly, that ought to get fixed first. If I come up with a reasonable patch, I'll file a new bug report. -- Bob From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 20 14:49:12 2010 Received: (at 7350) by debbugs.gnu.org; 20 Nov 2010 19:49:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJtQt-0005PK-TO for submit@debbugs.gnu.org; Sat, 20 Nov 2010 14:49:12 -0500 Received: from rgrjr.com ([216.146.47.5]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PJtQr-0005PE-Eu for 7350@debbugs.gnu.org; Sat, 20 Nov 2010 14:49:10 -0500 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 819E016010C for <7350@debbugs.gnu.org>; Sat, 20 Nov 2010 19:54:19 +0000 (UTC) Received: (qmail 29784 invoked by uid 89); 20 Nov 2010 19:54:18 -0000 Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 20 Nov 2010 19:54:18 -0000 Received: by rgr.rgrjr.com (Postfix, from userid 500) id 54367A4E6E; Sat, 20 Nov 2010 14:54:18 -0500 (EST) From: Bob Rogers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19688.10089.888644.949441@rgr.rgrjr.com> Date: Sat, 20 Nov 2010 14:54:17 -0500 To: Stefan Monnier Subject: Re: bug#7350: 24.0.50; make vc-deduce-backend smarter In-Reply-To: References: <19669.54304.980911.220632@rgr.rgrjr.com> <19671.7412.608640.593137@rgr.rgrjr.com> <19672.26151.150217.308712@rgr.rgrjr.com> X-Mailer: VM 7.19 under Emacs 24.0.50.1 X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 7350 Cc: 7350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) From: Stefan Monnier Date: Fri, 12 Nov 2010 08:48:30 -0500 > 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. I've installed the patch into the trunk (i.e. not for Emacs-23.3 but Emacs-24) and added compilation-mode to shell-mode, since it's also clearly linked to a particular location in the file-system. FWIW, the "32.1.4 Examining And Comparing Old Revisions" section of the Emacs info documentation says the following (tenth paragraph): If you invoke `C-x v =' or `C-u C-x v =' from a buffer that is neither visiting a version-controlled file nor a VC directory buffer, these commands generate a diff of all registered files in the current directory and its subdirectories. So it turns out that my expectation is what is actually documented after all. ;-} -- Bob From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 28 10:27:02 2012 Received: (at control) by debbugs.gnu.org; 28 Jul 2012 14:27:02 +0000 Received: from localhost ([127.0.0.1]:46574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sv7yv-0002ad-MJ for submit@debbugs.gnu.org; Sat, 28 Jul 2012 10:27:02 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:37854) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sv7yu-0002aQ-6O for control@debbugs.gnu.org; Sat, 28 Jul 2012 10:27:00 -0400 Received: by pbcwy7 with SMTP id wy7so6839896pbc.3 for ; Sat, 28 Jul 2012 07:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=4B9q6FFe46jHumd/gsNrlgewp86zX6Afbb9yjfIbN/A=; b=GvI8ciptPXoypa/8q1ubd7kgmfthzgRqWm68tcPubInfU3O6yRFljQRFWqufnwr0/7 lQHkGDbGbplsMrcctMc2vdNAva/fss+hMbFAICnLU0aggELmE89J6OgdxmZ4tVh/V/Uj 8boxTj/DRqbsxBSqVGQ3hU8MjIfQ9iIOo2S5G8PK8hJ0IqzK+Utm4VQECeZSUD7O6g6M oO2aQrHL4iwoUuaCEXoFc+ENadCBq0WB0paXziiYM4XLqOwTO0qtJXnz2scCKEwv87dp sqKdu1zuC+6KcyarfTBBv3jwJMLyaC53wM1MOXhLOPb1CfhnZByv4fUTeJVhqfVrxTL+ yEdQ== Received: by 10.66.88.65 with SMTP id be1mr12620041pab.28.1343485195907; Sat, 28 Jul 2012 07:19:55 -0700 (PDT) Received: from ulysses (cm162.gamma80.maxonline.com.sg. [202.156.80.162]) by mx.google.com with ESMTPS id mr1sm4042431pbb.62.2012.07.28.07.19.53 (version=SSLv3 cipher=OTHER); Sat, 28 Jul 2012 07:19:54 -0700 (PDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 7350 Date: Sat, 28 Jul 2012 22:19:51 +0800 Message-ID: <87ipd8ufw8.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) close 7350 thanks From unknown Sat Aug 16 22:00:18 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 26 Aug 2012 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator