unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: mcepl@redhat.com (Matěj Cepl)
To: 15303@debbugs.gnu.org
Subject: bug#15303: 24.3; [diff-mode] diff-hunk-kill doesn't update numbers in subsequent hunks
Date: Sat, 07 Sep 2013 22:01:47 +0200	[thread overview]
Message-ID: <87a9jo4d04.fsf@wycliff.ceplovi.cz> (raw)

1) Start Emacs
2) Open a patch file, it will open in a diff-mode
3) kill a hunk (Alt-K)

Example:

Let's have a patch with two subsequent hunks:

 curves = [
@@ -108,6 +117,9 @@ Hunk #2, a/tests/test_ec_curves.py curves = [
 #    ('ipsec4', 185),
 #]
 
+
+@unittest.skipUnless(EC_Module_Available,
+                     'Requires EC modules compiled into OpenSSL')
 class ECCurveTests(unittest.TestCase):
     #data = sha.sha('Kilroy was here!').digest()     # 160 bits
     data = "digest"     # keep short (48 bits) so lesser curves 
@@ -153,7 +165,8 @@ Hunk #3, a/tests/test_ec_curves.py def suite():
 
[end of example] 

When I am on line with @unittest.skipUnless and press Alt-K the result
is:

 curves = [
@@ -153,7 +165,8 @@ Hunk #3, a/tests/test_ec_curves.py def suite():

[end of example] 

That's actually wrong. The original hunk added three lines to the new
file, so when it is killed, the new line number in the hunk header
should be decreased by three, so the line should be

@@ -153,7 +162,8 @@

Best,

Matěj Cepl


In GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.8.2)
 of 2013-07-22 on x86-019.build.eng.bos.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.11402000
System Description:	Red Hat Enterprise Linux Workstation release 7.0 Beta (Maipo)

Configured using:
 `configure '--build=x86_64-redhat-linux-gnu'
 '--host=x86_64-redhat-linux-gnu' '--program-prefix='
 '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr'
 '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
 '--datadir=/usr/share' '--includedir=/usr/include'
 '--libdir=/usr/lib64' '--libexecdir=/usr/libexec'
 '--localstatedir=/var' '--sharedstatedir=/var/lib'
 '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus'
 '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff'
 '--with-xft' '--with-xpm' '--with-x-toolkit=gtk3' '--with-gpm=no'
 'build_alias=x86_64-redhat-linux-gnu'
 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
 --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic'
 'LDFLAGS=-Wl,-z,relro ''

Important settings:
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=ibus
  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-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x 5 2 <switch-frame> <help-echo> M-x <up> r e p o 
r t - e m <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-git...done
user-error: Beginning of history; no preceding item

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils vc-git diff-mode easymenu easy-mmode time-date
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar 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
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)





             reply	other threads:[~2013-09-07 20:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-07 20:01 Matěj Cepl [this message]
2013-09-09 18:18 ` bug#15303: 24.3; [diff-mode] diff-hunk-kill doesn't update numbers in subsequent hunks Stefan Monnier
2013-09-09 18:26   ` Matěj Cepl
2013-09-09 23:08     ` Stefan Monnier
2013-09-09 23:11       ` Matěj Cepl

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87a9jo4d04.fsf@wycliff.ceplovi.cz \
    --to=mcepl@redhat.com \
    --cc=15303@debbugs.gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).