all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 10827@debbugs.gnu.org
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	[thread overview]
Message-ID: <81pqc41xjz.fsf@gmail.com> (raw)
In-Reply-To: <jwv39916d9j.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 21 Mar 2012 14:07:50 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> 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 \#\<buffer\ devel-notes.org\> 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
+++ #<buffer 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---






  reply	other threads:[~2012-03-22 15:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 17:02 bug#10827: 24.0.93; M-RET behaviour with M-x diff-buffer-with-file RET Jambunathan K
2012-03-21 18:07 ` Stefan Monnier
2012-03-22 15:10   ` Jambunathan K [this message]
2012-03-24 15:59     ` Achim Gratz
2012-03-24 18:07       ` Stefan Monnier
2012-03-27 17:37         ` Achim Gratz
2013-11-15  5:09 ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81pqc41xjz.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=10827@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.