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 misinterprets empty lines. Date: Mon, 14 Jan 2008 16:08:13 -0500 Message-ID: References: <85ir3l767y.fsf@lola.goethe.zz> <87ir3d1tn7.fsf@penguin.cs.ucla.edu> <878x494f9w.fsf@rho.meyering.net> <857ijtwgpw.fsf@lola.goethe.zz> <87k5nt2xga.fsf@rho.meyering.net> <854pexur0g.fsf@lola.goethe.zz> <87hcix827c.fsf@penguin.cs.ucla.edu> <3n4pdrlshh.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1200344963 17912 80.91.229.12 (14 Jan 2008 21:09:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Jan 2008 21:09:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 14 22:09:44 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 1JEWYw-0004kJ-5U for ged-emacs-devel@m.gmane.org; Mon, 14 Jan 2008 22:09:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEWYX-0007br-QT for ged-emacs-devel@m.gmane.org; Mon, 14 Jan 2008 16:09:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JEWXc-0007FG-SZ for emacs-devel@gnu.org; Mon, 14 Jan 2008 16:08:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JEWXb-0007E3-4M for emacs-devel@gnu.org; Mon, 14 Jan 2008 16:08:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEWXb-0007Dy-18 for emacs-devel@gnu.org; Mon, 14 Jan 2008 16:08:19 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JEWXX-0007aZ-Fd; Mon, 14 Jan 2008 16:08:15 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CADtei0fO+KVp/2dsb2JhbACpSn0 X-IronPort-AV: E=Sophos;i="4.24,284,1196658000"; d="scan'208";a="12658155" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 14 Jan 2008 16:08:13 -0500 Original-Received: from pastel.home ([206.248.165.105]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id UWW64813; Mon, 14 Jan 2008 16:08:13 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 417BA8124; Mon, 14 Jan 2008 16:08:13 -0500 (EST) In-Reply-To: <3n4pdrlshh.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sat, 05 Jan 2008 19:15:06 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:86912 Archived-At: > In an effort to clear FOR-RELEASE, here is a simple-minded attempt to > deal with this. It seems to fix the original problem at least. It is problematic when you try to apply a hunk via C-c C-a because any empty line following your hunk (e.g. the last hunk in a C-x v =) will be taken as being part of the hunk and C-c C-a will think that the original text was just missing a newline and will add it (as a result of its fuzzy matching feature). Stefan > *** diff-mode.el.~1.122.~ 2007-10-21 13:00:12.000000000 -0700 > --- diff-mode.el 2008-01-05 15:58:41.000000000 -0800 > *************** > *** 403,409 **** > (setq style (diff-hunk-style style)) > (let ((end (and (re-search-forward (case style > ;; A `unified' header is ambiguous. > ! (unified (concat "^[^-+# \\]\\|" > diff-file-header-re)) > (context "^[^-+#! \\]") > (normal "^[^<>#\\]") > --- 403,409 ---- > (setq style (diff-hunk-style style)) > (let ((end (and (re-search-forward (case style > ;; A `unified' header is ambiguous. > ! (unified (concat "^[^-+# \\\n]\\|" > diff-file-header-re)) > (context "^[^-+#! \\]") > (normal "^[^<>#\\]")