From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.bugs Subject: bug#10827: 24.0.93; M-RET behaviour with M-x diff-buffer-with-file RET Date: Thu, 22 Mar 2012 20:40:24 +0530 Message-ID: <81pqc41xjz.fsf@gmail.com> References: <81k43mu2x7.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1332429092 28880 80.91.229.3 (22 Mar 2012 15:11:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Mar 2012 15:11:32 +0000 (UTC) Cc: 10827@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 22 16:11:30 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SAjfi-0002Dl-BI for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Mar 2012 16:11:26 +0100 Original-Received: from localhost ([::1]:33822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAjfh-0001eN-LL for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Mar 2012 11:11:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAjfe-0001dg-1F for bug-gnu-emacs@gnu.org; Thu, 22 Mar 2012 11:11:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SAjfX-0008IZ-JI for bug-gnu-emacs@gnu.org; Thu, 22 Mar 2012 11:11:21 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAjfX-0008IN-Ct for bug-gnu-emacs@gnu.org; Thu, 22 Mar 2012 11:11:15 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SAk9K-0001R1-7Q for bug-gnu-emacs@gnu.org; Thu, 22 Mar 2012 11:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jambunathan K Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Mar 2012 15:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10827 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10827-submit@debbugs.gnu.org id=B10827.13324309125499 (code B ref 10827); Thu, 22 Mar 2012 15:42:02 +0000 Original-Received: (at 10827) by debbugs.gnu.org; 22 Mar 2012 15:41:52 +0000 Original-Received: from localhost ([127.0.0.1]:33328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SAk99-0001Qd-8a for submit@debbugs.gnu.org; Thu, 22 Mar 2012 11:41:52 -0400 Original-Received: from mail-yw0-f44.google.com ([209.85.213.44]:47040) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SAk8o-0001QC-0T for 10827@debbugs.gnu.org; Thu, 22 Mar 2012 11:41:49 -0400 Original-Received: by yhkk25 with SMTP id k25so1807535yhk.3 for <10827@debbugs.gnu.org>; Thu, 22 Mar 2012 08:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=k4W4OdOK5vzl1AT0jJqsWOYYdajaF5Okag0HsI7ap9U=; b=D5fnv62OTnTHNwACOsk7Chp/Z0xyduRnNQsdUzmkR9RugXiLVnFgpCYSohMMwzHb5U JMVO3kErQ7xi/div/wpafyv46vuxOhQ2U6pVU/HyHeuUf2Vpjitb8xVf52NhmERRLtOT +q44z5rN+jvg1JGKbwspgksT86tJsyYc9wousDbAlPAl7K60MwFjjx+CTHd+tFadgUGK Cutw8UdJcqeidkdnwqechebLqo20lzQ/vLWUiZn51PFDptot8+R/aM1sdzfMsnKpTvyG 4epV9QWUWM6M0tAYlErTz5zT/s86uo4JhPEtC7HZL9XE3lpnd6ud6MoIrl6r3BRvtO0a 7spw== Original-Received: by 10.68.204.131 with SMTP id ky3mr21237264pbc.69.1332429041539; Thu, 22 Mar 2012 08:10:41 -0700 (PDT) Original-Received: from JAMBU-NETBOOK ([115.241.89.87]) by mx.google.com with ESMTPS id g4sm3977698pbt.58.2012.03.22.08.10.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Mar 2012 08:10:40 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 21 Mar 2012 14:07:50 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (windows-nt) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:57964 Archived-At: Stefan Monnier writes: >> 1. Make some modification to a file and don't save it. >> 2. Do M-x diff-buffer-with-file RET. >> 3. Pick a modified line and press M-RET. >> 4. Now the user is prompted for a file. > > When I try it, Emacs just jumps to the corresponding line in the > original buffer without prompting the user for a file name. > Could the problem be triggered by some particular customization > of yours? (I.e. try to reproduce it with "emacs -Q" and if the problem > doesn't appear there, try to figure out which part of your config > triggers the problem). I am on Windows + Cygwin. The immediate problem seems to be that `diff-hunk-file-names' assumes that file names have no spaces. If I (blindly) modify the following regexp in `diff-hunk-file-names' --8<---------------cut here---------------start------------->8--- "[-*][-*][-*] \\(\\S-+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(\\S-+\\)" --8<---------------cut here---------------end--------------->8--- to --8<---------------cut here---------------start------------->8--- "[-*][-*][-*] \\(.+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(.+\\)" ^^^^^^^^ ^^^^^^^^^ --8<---------------cut here---------------end--------------->8--- I get the right behaviour. Down below is a *Diff* buffer that I get with `diff-buffer-with-file'. With re-builder, you can see that the first regexp fails to "collect" the files correctly. The regexp (incorrectly) matches only part of the filename/buffer name and not the whole name. I also have my doubts regarding the correctness of another regexp towards the end of `diff-hunk-file-names' which looks like this. --8<---------------cut here---------------start------------->8--- "^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?" --8<---------------cut here---------------end--------------->8--- In summary, review the regexps in lisp/vc/diff-mode.el so that they do the right thing on Windows where filenames can have spaces. --8<---------------cut here---------------start------------->8--- diff -pub -L c\:/Documents\ and\ Settings/kjambunathan/My\ Documents/My\ Data/devel/devel-notes.org -L \#\ c\:/Documents\ and\ Settings/kjambunathan/My\ Documents/My\ Data/devel/devel-notes.org c\:/Documents\ and\ Settings/kjambunathan/My\ Documents/My\ Data/tmp/buffer-content-3804sEa --- c:/Documents and Settings/kjambunathan/My Documents/My Data/devel/devel-notes.org +++ # @@ -4,6 +4,7 @@ + http://cygwin.com/ml/cygwin/2006-05/msg00756.html # texi to pdf conversion using miktex Diff finished. Thu Mar 22 20:04:55 2012 --8<---------------cut here---------------end--------------->8---