GNU bug report logs - #8672
23.3; diff-fixup-modifs fails for some small diffs

Previous Next

Package: emacs;

Reported by: PJ Weisberg <pj <at> irregularexpressions.net>

Date: Sat, 14 May 2011 20:28:01 UTC

Severity: normal

Found in version 23.3

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8672 in the body.
You can then email your comments to 8672 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8672; Package emacs. (Sat, 14 May 2011 20:28:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to PJ Weisberg <pj <at> irregularexpressions.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 14 May 2011 20:28:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: PJ Weisberg <pj <at> irregularexpressions.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.3; diff-fixup-modifs fails for some small diffs
Date: Sat, 14 May 2011 13:27:26 -0700
[Message part 1 (text/plain, inline)]
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 <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 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:
<help-echo> <help-echo> <help-echo> M-x d i f <tab>
SPC f i <tab> x <tab> <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: 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)
[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8672; Package emacs. (Sun, 15 May 2011 14:11:01 GMT) Full text and rfc822 format available.

Message #8 received at 8672 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: PJ Weisberg <pj <at> irregularexpressions.net>
Cc: 8672 <at> debbugs.gnu.org
Subject: Re: bug#8672: 23.3; diff-fixup-modifs fails for some small diffs
Date: Sun, 15 May 2011 10:09:59 -0400
PJ Weisberg <pj <at> irregularexpressions.net> writes:

> echo test > file.txt
> echo "foo\ntest\nbar" > other.txt
> diff -u file.txt other.txt > diff.patch
>
> Now open that file with emacs -Q and run 'M-x diff-fixup-modifs'.  It
> chokes because there's no , after the -1.

Thanks, I have committed a fix.




bug closed, send any further explanations to 8672 <at> debbugs.gnu.org and PJ Weisberg <pj <at> irregularexpressions.net> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sun, 15 May 2011 14:11:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 13 Jun 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 63 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.