GNU bug report logs - #25410
26.0.50; Refine an unified diff hunk only if adds lines

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Tue, 10 Jan 2017 10:09:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 26.0.50

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #34 received at 25410 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 25410 <at> debbugs.gnu.org
Subject: Re: bug#25410: 26.0.50; Refine an unified diff hunk only if adds lines
Date: Fri, 13 Jan 2017 11:31:10 -0500
On Fri, Jan 13, 2017 at 1:14 AM, Tino Calancha <tino.calancha <at> gmail.com> wrote:
>
>> +         (while (re-search-forward "^-" end t)
>> +           (let ((beg-del (progn (beginning-of-line) (point)))
>> +                 beg-add end-add)
>> +             (when (and (diff--forward-while-leading-char ?- end)
>> +                        ;; Allow for "\ No newline at end of file".
>> +                        (progn (diff--forward-while-leading-char ?\\ end)
>> +                               (setq beg-add (point)))
>> +                        (diff--forward-while-leading-char ?+ end)
>> +                        (progn (diff--forward-while-leading-char ?\\ end)
>> +                               (setq end-add (point))))
>
> How about hide the complexity resulting for checking ?\\ inside the
> auxiliary function?

I'm okay with doing this, but I slightly prefer leaving the complexity
at the top level. I think pushing the ?\\ check inside
diff--forward-while-leading-char makes that function's purpose a bit
incoherent and the complexity reduction in the caller doesn't look
significant enough to balance that.




This bug report was last modified 8 years and 124 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.