emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: diff-yank-handler is evil


From: Jesper Harder
Subject: Re: diff-yank-handler is evil
Date: Wed, 24 Mar 2004 21:47:50 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> Leading '+', '!' and '-' are stripped -- it's no longer a valid diff
>> after yanking.  It's not useful to send someone a bogus diff.
>
> Please give us an example.

Enable font-lock.  Place the following in a buffer in diff-mode:

======================================================================
diff -c /home/harder/t1.txt /home/harder/t2.txt
*** /home/harder/t1.txt Wed Mar 24 21:34:50 2004
--- /home/harder/t2.txt Wed Mar 24 21:35:07 2004
***************
*** 1,4 ****
! Foo.
  Bar.
  
  Bla bla bla.
--- 1,4 ----
! FOO.
  Bar.
  
  Bla bla bla.
***************
*** 6,8 ****
--- 6,9 ----
  Bla bla bla.
  
  
+ Baz.

Diff finished.  Wed Mar 24 21:35:12 2004
======================================================================

Mark the contents, and paste to a different buffer.  The result is:

======================================================================
diff -c /home/harder/t1.txt /home/harder/t2.txt
*** /home/harder/t1.txt Wed Mar 24 21:34:50 2004
-- /home/harder/t2.txt  Wed Mar 24 21:35:07 2004
***************
*** 1,4 ****
Foo.
  Bar.
  
  Bla bla bla.
--- 1,4 ----
FOO.
  Bar.
  
  Bla bla bla.
***************
*** 6,8 ****
-- 6,9 ----
 Bla bla bla.
 
 
 Baz.

Diff finished.  Wed Mar 24 21:35:12 2004
======================================================================

The '!'s and '+'s are missing, i.e. a bogus diff.

>>> BTW, C-x u will undo the munge if you don't want it.
>> No.  Some of the damage is undone, but it's still corrupted.
>
> That's definitely a bug I don't know about, so please show us an example.

Press `C-x u' once:

======================================================================
diff -c /home/harder/t1.txt /home/harder/t2.txt
*** /home/harder/t1.txt Wed Mar 24 21:34:50 2004
-- /home/harder/t2.txt  Wed Mar 24 21:35:07 2004
***************
*** 1,4 ****
Foo.
  Bar.
  
  Bla bla bla.
--- 1,4 ----
FOO.
  Bar.
  
  Bla bla bla.
***************
*** 6,8 ****
-- 6,9 ----
 Bla bla bla.
 
 
+ Baz.

Diff finished.  Wed Mar 24 21:35:12 2004
======================================================================

Press `C-x u' once more:

======================================================================
diff -c /home/harder/t1.txt /home/harder/t2.txt
*** /home/harder/t1.txt Wed Mar 24 21:34:50 2004
-- /home/harder/t2.txt  Wed Mar 24 21:35:07 2004
***************
*** 1,4 ****
! Foo.
  Bar.
  
  Bla bla bla.
--- 1,4 ----
! FOO.
  Bar.
  
  Bla bla bla.
======================================================================

I.e. the munging isn't undone.

> <rant>
> I expect people on this list to know better than to send just some
> nondescript text vaguely referring to "a problem" where things "don't work"
> or are "corrupted".  Please go back and learn how to submit a proper
> bug report.
> </rant>

Come on, "missing !'s when pasting" is pretty specific.  Besides, this
behaviour was so easy to trigger, that I didn't think you'd need a
verbose 140 line bug-report to reproduce it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]