emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: diff-mode misinterprets empty lines.


From: Stefan Monnier
Subject: Re: diff-mode misinterprets empty lines.
Date: Mon, 14 Jan 2008 16:08:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

> 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 "^[^<>#\\]")




reply via email to

[Prev in Thread] Current Thread [Next in Thread]