From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#17522: diff-mode frustrates attempt to correct corrupted diff file. Date: Wed, 21 May 2014 21:56:36 +0000 Message-ID: <20140521215636.GA3908@acm.acm> References: <20140518105055.GA3727@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1400709755 25749 80.91.229.3 (21 May 2014 22:02:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 May 2014 22:02:35 +0000 (UTC) Cc: 17522@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 22 00:02:24 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WnEab-0007IN-9Y for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 May 2014 00:02:21 +0200 Original-Received: from localhost ([::1]:33779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnEaa-0004Al-V0 for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 May 2014 18:02:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnEaQ-0004AX-TU for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 18:02:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnEaJ-00036d-Dy for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 18:02:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnEaJ-00036Z-BZ for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 18:02:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WnEaI-0004tA-Mx for bug-gnu-emacs@gnu.org; Wed, 21 May 2014 18:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 May 2014 22:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17522 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17522-submit@debbugs.gnu.org id=B17522.140070966218649 (code B ref 17522); Wed, 21 May 2014 22:02:02 +0000 Original-Received: (at 17522) by debbugs.gnu.org; 21 May 2014 22:01:02 +0000 Original-Received: from localhost ([127.0.0.1]:55644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WnEZJ-0004qI-J2 for submit@debbugs.gnu.org; Wed, 21 May 2014 18:01:02 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:27347 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WnEZG-0004q4-76 for 17522@debbugs.gnu.org; Wed, 21 May 2014 18:00:59 -0400 Original-Received: (qmail 29825 invoked by uid 3782); 21 May 2014 22:00:54 -0000 Original-Received: from acm.muc.de (pD9518BA2.dip0.t-ipconnect.de [217.81.139.162]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 22 May 2014 00:00:53 +0200 Original-Received: (qmail 4840 invoked by uid 1000); 21 May 2014 21:56:36 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:89336 Archived-At: Hi, Stefan. On Tue, May 20, 2014 at 09:54:02AM -0400, Stefan Monnier wrote: > > @@ -3155,0 +3160,0 @ > > . This is surely a bug. The workaround seems to be to use Fundamental > > Mode. > Maybe not a bug, but a misfeature: the ",0" is probably because the first > line after the @...@ is empty, which normally "can't" be part of a hunk, > so this empty line is taken as an "end of hunk". OK. But patch appears to accept a blank line (in a unified diff) without complaint. > If you add a space on that line, the count should be updated again and > start looking more sane. This is all besides the point. I did not edit the hunk header, therefore I don't expect it to be changed behind my back. If I need the header to be recalculated, surely there should be a command for that. (There is, but it doesn't have a key binding.) At the very least, surely Diff Mode should _ask_ me before splatting my file. Or at the very, very least even _inform_ me that it has done so, rather than leaving it up to patch to issue its bewildering error message. Why do people hand edit patches anyway? Clearly, because patches sometimes get corrupted, e.g. by email software, as happened to me. For this case, it doesn't make sense to recalculate the header. But for other reasons? Why would anybody edit a patch hunk other than to repair it? It's not something I can imagine myself wanting to do. > Stefan -- Alan Mackenzie (Nuremberg, Germany).