From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: PJ Weisberg Newsgroups: gmane.emacs.bugs Subject: bug#8672: 23.3; diff-fixup-modifs fails for some small diffs Date: Sat, 14 May 2011 13:27:26 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0015174734302a24cc04a34240ba X-Trace: dough.gmane.org 1305404895 21379 80.91.229.12 (14 May 2011 20:28:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 14 May 2011 20:28:15 +0000 (UTC) To: 8672@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 14 22:28:10 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QLLRZ-0003b8-Lk for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 May 2011 22:28:09 +0200 Original-Received: from localhost ([::1]:49741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLLRY-0007N4-To for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 May 2011 16:28:08 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLLRU-0007Mi-2b for bug-gnu-emacs@gnu.org; Sat, 14 May 2011 16:28:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLLRS-0001Lb-G2 for bug-gnu-emacs@gnu.org; Sat, 14 May 2011 16:28:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLLRS-0001LV-3c for bug-gnu-emacs@gnu.org; Sat, 14 May 2011 16:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QLLRR-0005fR-QF; Sat, 14 May 2011 16:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: PJ Weisberg Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 May 2011 20:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.130540486621759 (code B ref -1); Sat, 14 May 2011 20:28:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 May 2011 20:27:46 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QLLRA-0005eu-Uc for submit@debbugs.gnu.org; Sat, 14 May 2011 16:27:45 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QLLR8-0005ei-AV for submit@debbugs.gnu.org; Sat, 14 May 2011 16:27:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLLR1-0001Jd-SQ for submit@debbugs.gnu.org; Sat, 14 May 2011 16:27:37 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:38786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLLR1-0001JZ-QN for submit@debbugs.gnu.org; Sat, 14 May 2011 16:27:35 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLLR0-0007MT-Ch for bug-gnu-emacs@gnu.org; Sat, 14 May 2011 16:27:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLLQy-0001Iw-Eu for bug-gnu-emacs@gnu.org; Sat, 14 May 2011 16:27:34 -0400 Original-Received: from p3plsmtpa06-05.prod.phx3.secureserver.net ([173.201.192.106]:34296) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QLLQx-0001Ib-Uu for bug-gnu-emacs@gnu.org; Sat, 14 May 2011 16:27:32 -0400 Original-Received: (qmail 21473 invoked from network); 14 May 2011 20:27:28 -0000 Original-Received: from unknown (209.85.161.41) by p3plsmtpa06-05.prod.phx3.secureserver.net (173.201.192.106) with ESMTP; 14 May 2011 20:27:28 -0000 Original-Received: by fxm18 with SMTP id 18so2969200fxm.0 for ; Sat, 14 May 2011 13:27:26 -0700 (PDT) Original-Received: by 10.223.57.86 with SMTP id b22mr1281510fah.95.1305404846515; Sat, 14 May 2011 13:27:26 -0700 (PDT) Original-Received: by 10.223.69.141 with HTTP; Sat, 14 May 2011 13:27:26 -0700 (PDT) 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, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 14 May 2011 16:28:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:46467 Archived-At: --0015174734302a24cc04a34240ba Content-Type: text/plain; charset=ISO-8859-1 Start with these commands in the shell: echo test > file.txt echo "foo\ntest\nbar" > other.txt diff -u file.txt other.txt > diff.patch The resulting diff.patch contains: --- other.txt 2011-05-14 12:56:21.000000000 -0700 +++ file.txt 2011-05-12 23:35:47.000000000 -0700 @@ -1 +1,3 @@ +foo text +bar Now open that file with emacs -Q and run 'M-x diff-fixup-modifs'. It chokes because there's no , after the -1. If I'm reading diff-mode.el correctly, the line that raises the error will *always* raise that error, because it's trying to use (match-end 2) as a character position after (match-string 2) has already returned nil. Oops. :-/ In case it matters, my version of diff is: $ diff --version diff (GNU diffutils) 3.0 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Paul Eggert, Mike Haertel, David Hayes, Richard Stallman, and Len Tower. In GNU Emacs 23.3.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2011-04-10 on raven, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10905000 configured using `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.3/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.3/leim' '--with-x=yes' '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' '--without-gconf' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Diff Minor modes in effect: diff-auto-refine-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x d i f SPC f i x M-x r e p o r Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Loading vc-git...done Making completion list... call-interactively: Wrong type argument: integer-or-marker-p, nil Load-path shadows: /usr/share/emacs/23.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup /usr/share/emacs/23.3/site-lisp/html-helper-mode/tempo hides /usr/share/emacs/23.3/lisp/tempo /usr/share/emacs/23.3/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/23.3/lisp/textmodes/flyspell /usr/share/emacs/23.3/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/23.3/lisp/textmodes/ispell /usr/share/emacs/23.3/site-lisp/css-mode/css-mode hides /usr/share/emacs/23.3/lisp/textmodes/css-mode Features: (shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug help-mode view vc-git diff-mode easymenu easy-mmode tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind font-render-setting x-toolkit x multi-tty emacs) --0015174734302a24cc04a34240ba Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Start with these commands in the shell:

echo test > file.txt
e= cho "foo\ntest\nbar" > other.txt
diff -u file.txt other.txt= > diff.patch

The resulting diff.patch contains:

--- other= .txt=A0=A0=A0 2011-05-14 12:56:21.000000000 -0700
+++ file.txt=A0=A0=A0 2011-05-12 23:35:47.000000000 -0700
@@ -1 +1,3 @@<= br>+foo
=A0text
+bar

Now open that file with emacs -Q and run = 'M-x diff-fixup-modifs'.=A0 It
chokes because there's no , a= fter the -1.

If I'm reading diff-mode.el correctly, the line that raises the err= or
will *always* raise that error, because it's trying to use (match= -end 2)
as a character position after (match-string 2) has already retur= ned
nil.=A0 Oops. :-/

In case it matters, my version of diff is:

= $ diff --version
diff (GNU diffutils) 3.0
Copyright (C) 2010 Free Sof= tware Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html= >.
This is free software: you are free to change and redistribute it.
There= is NO WARRANTY, to the extent permitted by law.

Written by Paul Egg= ert, Mike Haertel, David Hayes,
Richard Stallman, and Len Tower.


In GNU Emacs 23.3.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bar= s)
=A0of 2011-04-10 on raven, modified by Debian
Windowing system dis= tributor `The X.Org Foundation', version 11.0.10905000
configured us= ing `configure=A0 '--build' 'i486-linux-gnu' '--build&#= 39; 'i486-linux-gnu' '--prefix=3D/usr' '--sharedstatedi= r=3D/var/lib' '--libexecdir=3D/usr/lib' '--localstatedir=3D= /var/lib' '--infodir=3D/usr/share/info' '--mandir=3D/usr/sh= are/man' '--with-pop=3Dyes' '--enable-locallisppath=3D/etc/= emacs23:/etc/emacs:/usr/local/share/emacs/23.3/site-lisp:/usr/local/share/e= macs/site-lisp:/usr/share/emacs/23.3/site-lisp:/usr/share/emacs/site-lisp:/= usr/share/emacs/23.3/leim' '--with-x=3Dyes' '--with-x-toolk= it=3Dlucid' '--with-toolkit-scroll-bars' '--without-gconf&#= 39; 'build_alias=3Di486-linux-gnu' 'CFLAGS=3D-DDEBIAN -g -O2= 9; 'LDFLAGS=3D-g' 'CPPFLAGS=3D''

Important settings:
=A0 value of $LC_ALL: nil
=A0 value of $LC_CO= LLATE: nil
=A0 value of $LC_CTYPE: nil
=A0 value of $LC_MESSAGES: nil=
=A0 value of $LC_MONETARY: nil
=A0 value of $LC_NUMERIC: nil
=A0 = value of $LC_TIME: nil
=A0 value of $LANG: en_US.UTF-8
=A0 value of $XMODIFIERS: nil
=A0 loc= ale-coding-system: utf-8-unix
=A0 default enable-multibyte-characters: t=

Major mode: Diff

Minor modes in effect:
=A0 diff-auto-ref= ine-mode: t
=A0 tooltip-mode: t
=A0 mouse-wheel-mode: t
=A0 tool-bar-mode: t
= =A0 menu-bar-mode: t
=A0 file-name-shadow-mode: t
=A0 global-font-loc= k-mode: t
=A0 font-lock-mode: t
=A0 blink-cursor-mode: t
=A0 auto-= encryption-mode: t
=A0 auto-compression-mode: t
=A0 line-number-mode: t
=A0 transient-ma= rk-mode: t

Recent input:
<help-echo> <help-echo> <= help-echo> M-x d i f <tab>
SPC f i <tab> x <tab> &= lt;return> <help-echo> M-x r e
p o r <tab> <return>

Recent messages:
For information= about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-git...done=
Making completion list...
call-interactively: Wrong type argument: i= nteger-or-marker-p, nil

Load-path shadows:
/usr/share/emacs/23.3/site-lisp/debian-startup hi= des /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs/23.3/site= -lisp/html-helper-mode/tempo hides /usr/share/emacs/23.3/lisp/tempo
/usr/share/emacs/23.3/site-lisp/dictionaries-common/flyspell hides /usr/sha= re/emacs/23.3/lisp/textmodes/flyspell
/usr/share/emacs/23.3/site-lisp/di= ctionaries-common/ispell hides /usr/share/emacs/23.3/lisp/textmodes/ispell<= br> /usr/share/emacs/23.3/site-lisp/css-mode/css-mode hides /usr/share/emacs/23= .3/lisp/textmodes/css-mode

Features:
(shadow sort mail-extr messa= ge sendmail regexp-opt ecomplete rfc822 mml
mml-sec password-cache mm-de= code mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
netr= c time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
sha= 1 hex-util hashcash mail-utils emacsbug help-mode view vc-git
diff-mode = easymenu easy-mmode tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset
ima= ge fringe lisp-mode register page menu-bar rfn-eshadow timer select
scro= ll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
frame c= ham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech europeanethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook helpsimple abbrev loaddefs button minibuffer faces cus-face files
text-prop= erties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process dbusbind
= font-render-setting x-toolkit x multi-tty emacs)

--0015174734302a24cc04a34240ba--