From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: diff-mode: C-c C-c fails when location of hunk has been changed. C-d bound to backward-word. Date: Mon, 26 May 2008 11:55:46 -0400 Message-ID: References: <20080526140422.GC4758@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1211817375 32385 80.91.229.12 (26 May 2008 15:56:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 May 2008 15:56:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 26 17:56:46 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K0f41-0003dH-U5 for ged-emacs-devel@m.gmane.org; Mon, 26 May 2008 17:56:46 +0200 Original-Received: from localhost ([127.0.0.1]:34775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0f3G-0003Og-T2 for ged-emacs-devel@m.gmane.org; Mon, 26 May 2008 11:55:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0f3B-0003Lz-L4 for emacs-devel@gnu.org; Mon, 26 May 2008 11:55:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0f3A-0003JP-29 for emacs-devel@gnu.org; Mon, 26 May 2008 11:55:53 -0400 Original-Received: from [199.232.76.173] (port=41166 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0f39-0003J6-Sg for emacs-devel@gnu.org; Mon, 26 May 2008 11:55:51 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:33215) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K0f39-00058e-Ga for emacs-devel@gnu.org; Mon, 26 May 2008 11:55:51 -0400 Original-Received: from ceviche.home (vpn-132-204-232-176.acd.umontreal.ca [132.204.232.176]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id m4QFtm8A010626 for ; Mon, 26 May 2008 11:55:48 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 012D1B408C; Mon, 26 May 2008 11:55:46 -0400 (EDT) In-Reply-To: <20080526140422.GC4758@muc.de> (Alan Mackenzie's message of "Mon, 26 May 2008 14:04:22 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3024=0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:97731 Archived-At: > In diff mode, whilst on a hunk, do C-c C-c. This fails to find the > changed text in the target buffer, because it is now too far away from > where it was. Fair enough. Hmm... actually, it does an unbounded search, so it should find a place if one exists. It may not be the right one, of course. Could you give a detailed recipe to reproduce the problem? > Now edit the diff hunk so that the line number is now correct. I.e., > change: > *** 2078,2084 **** > to > *** 2128,2134 **** > . Now do C-c C-c again. Point is left at L2078 in the target buffer, > not L2128. THIS IS A BUG. Could be. Depends on a lot of things. E.g. are the from&to file names identical? Is point in the `from' or the `to' part of the hunk? Is the location of the hunk found? What does the hunk look like? > ######################################################################### > Whilst in the diff mode buffer, type C-d here: > *** 2078,2084 **** > ^ > The apparent effect of this is backward-word. This is unfriendly. > (What actually happens is that an after-command hook recalculates 2084 > and splats it into position.) > I think it would be better if diff-mode beeped with a message, e.g. > "End of hunk line-number cannot be edited". IIRC the after-command hook tries to stay out of the way if you touch any of the headers. Indeed, it seems to DTRT for unified hunks, but not for context ones. I'll take a look at it. Stefan