From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#4677: allow VC operations from dired Date: Thu, 19 Nov 2009 08:50:55 -0800 (PST) Message-ID: <200911191650.nAJGotfn021379@godzilla.ics.uci.edu> References: <200910082019.n98KJxFW020300@godzilla.ics.uci.edu> <87k4z1o58n.fsf@mail.jurta.org> <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> Reply-To: Dan Nicolaescu , 4677@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1258651505 11188 80.91.229.12 (19 Nov 2009 17:25:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 17:25:05 +0000 (UTC) Cc: 4677@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 18:24:57 2009 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.50) id 1NBAkb-0003IH-6o for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 18:24:57 +0100 Original-Received: from localhost ([127.0.0.1]:60098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBAka-0002bq-GQ for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 12:24:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBATj-0005f4-V7 for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 12:07:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBATe-0005bB-4U for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 12:07:30 -0500 Original-Received: from [199.232.76.173] (port=45703 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBATd-0005aw-Tm for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 12:07:25 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55399) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NBATb-0007Ea-WE for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 12:07:24 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAJH7KMJ020569; Thu, 19 Nov 2009 09:07:21 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAJH0521019139; Thu, 19 Nov 2009 09:00:05 -0800 Resent-Date: Thu, 19 Nov 2009 09:00:05 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 19 Nov 2009 17:00:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4677 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4677-submit@emacsbugs.donarmstrong.com id=B4677.125864947018589 (code B ref 4677); Thu, 19 Nov 2009 17:00:05 +0000 Original-Received: (at 4677) by emacsbugs.donarmstrong.com; 19 Nov 2009 16:51:10 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from paul-mcgann-v0.ics.uci.edu (paul-mcgann-v0.ics.uci.edu [128.195.1.147]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAJGp8wW018586 for <4677@emacsbugs.donarmstrong.com>; Thu, 19 Nov 2009 08:51:09 -0800 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nAJGouPt017087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Nov 2009 08:50:56 -0800 Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nAJGotfn021379; Thu, 19 Nov 2009 08:50:55 -0800 (PST) In-Reply-To: <200910120246.n9C2kOsV025230@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Sun, 11 Oct 2009 19:46:24 -0700 (PDT)") Original-Lines: 76 X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nAJGouPt017087 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 19 Nov 2009 12:07:30 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:32717 Archived-At: Dan Nicolaescu writes: > Juri Linkov writes: > > > > This patch allows VC operations to be run from dired. > > > State changing VC operations are not supported. > > > (only the various variations of log and diff) > > > > Thanks, it works right except in one case: when called outside of > > a repository controlled directory, it traverses all subdirectories > > trying to find a repository (I think traversing subdirectories > > makes no sense in this case) and later fails with: > > > > Wrong type argument: stringp, nil > > Thanks. Here's an updated patch. Stefan, any reason not to install this patch (the up to date version of it)? > Index: vc.el > =================================================================== > RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v > retrieving revision 1.732 > diff -u -3 -p -u -p -r1.732 vc.el > --- vc.el 3 Oct 2009 18:29:26 -0000 1.732 > +++ vc.el 12 Oct 2009 02:41:06 -0000 > @@ -634,7 +631,8 @@ > (require 'vc-dispatcher) > > (eval-when-compile > - (require 'cl)) > + (require 'cl) > + (require 'dired)) > > (unless (assoc 'vc-parent-buffer minor-mode-alist) > (setq minor-mode-alist > @@ -889,6 +906,10 @@ current buffer." > (cond > ((derived-mode-p 'vc-dir-mode) > (vc-dir-deduce-fileset state-model-only-files)) > + ((derived-mode-p 'dired-mode) > + (if observer > + (vc-dired-deduce-fileset) > + (error "State changing VC operations not supported in `dired-mode'"))) > ((setq backend (vc-backend buffer-file-name)) > (if state-model-only-files > (list backend (list buffer-file-name) > @@ -921,4 +942,11 @@ > > + > +(defun vc-dired-deduce-fileset () > + (let ((backend (vc-backend default-directory))) > + (unless backend (error "Directory not under VC")) > + (list backend > + (dired-map-over-marks (dired-get-filename nil t) nil)))) > + > (defun vc-ensure-vc-buffer () > "Make sure that the current buffer visits a version-controlled file." > (cond > @@ -1590,6 +1618,7 @@ 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)))) > rootdir working-revision) > (unless backend > @@ -1881,6 +1913,7 @@ If WORKING-REVISION is non-nil, leave th > (interactive) > (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)))) > rootdir working-revision) > (unless backend