From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#25410: 26.0.50; Refine an unified diff hunk only if adds lines Date: Fri, 13 Jan 2017 11:31:10 -0500 Message-ID: References: <8737grz0q3.fsf@gmail.com> <8737gr0zbn.fsf@users.sourceforge.net> <87fukqe2eu.fsf@gmail.com> <8760lmqak1.fsf@gmail.com> <87wpe0zz0s.fsf@users.sourceforge.net> <87inpjzhpb.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1496075673 3792 195.159.176.226 (29 May 2017 16:34:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 May 2017 16:34:33 +0000 (UTC) Cc: 25410@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 13 17:32:29 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cS4m0-000843-PA for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jan 2017 17:32:16 +0100 Original-Received: from localhost ([::1]:43313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cS4m5-0002eZ-5G for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jan 2017 11:32:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cS4lr-0002bv-3Y for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2017 11:32:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cS4lm-0005Du-7Z for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2017 11:32:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37680) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cS4lm-0005Dq-3Y for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2017 11:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cS4ll-0001A5-Q6 for bug-gnu-emacs@gnu.org; Fri, 13 Jan 2017 11:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Jan 2017 16:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25410 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 25410-submit@debbugs.gnu.org id=B25410.14843250784412 (code B ref 25410); Fri, 13 Jan 2017 16:32:01 +0000 Original-Received: (at 25410) by debbugs.gnu.org; 13 Jan 2017 16:31:18 +0000 Original-Received: from localhost ([127.0.0.1]:53079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cS4l4-000196-0J for submit@debbugs.gnu.org; Fri, 13 Jan 2017 11:31:18 -0500 Original-Received: from mail-oi0-f65.google.com ([209.85.218.65]:34899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cS4l2-00018r-89 for 25410@debbugs.gnu.org; Fri, 13 Jan 2017 11:31:16 -0500 Original-Received: by mail-oi0-f65.google.com with SMTP id x84so7392702oix.2 for <25410@debbugs.gnu.org>; Fri, 13 Jan 2017 08:31:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=1wFPIaFhqhsnX8DmCI4a2ma6rMFZ3V9+YmjP2FNe8gU=; b=Fm7BIV8susi/TJBzSSTwCk+XkUkaYfzGmTPBLh7YMPh7XKq+4tIsI1FFLcKhRNTQNK tt5Bip/TxZH856CjBqE3ue6hzf37n8FKXByR0/YG/yvr98b/WXUUq/L2jx+1vYhQKfJG PQeRg6L7uujIQGJhZwp78wntM6oRjnKPbOEMbliOKy4j5Fpy7NTqd1mzXsQmmdYG7FOG uA7N9hEhpyiKyhxxSbG0ct3HddLGhbRwt2mp1Bqkumkk8WAHSUFOKBiBkX3z8QcYch/+ W5q3t0mWj+TtqinnLhABRcOPcam000TLNarJBzHX2ava0QcJR8nSyip0rGE2AsXH/cNB WMGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=1wFPIaFhqhsnX8DmCI4a2ma6rMFZ3V9+YmjP2FNe8gU=; b=EqsL1xJArI9jO7l/NO48oc1Vwxc5AIZ8xzZKsLvfEQ7b6p6ZzirxdLdRROdW/dBDE/ +LhzB6bFXbe16six54Pgy5jFawnlJZtvYb8EZcJFpFl3fJ1xCFjHTjQB0f+uaxWLGREY I4IBTMxyI1zplVABcJEf4NE5dsvjnO5bSwW79vmDjM4Z3IdexV/UKrZH3W5YyLysKbQw x034zB1had3HuK4nUDxy7wgqC6ZjDiyevub74fC26JMGbImBdExaJHwsQPeElnCt9SQm aOylFRX1dHC5bGITM7IuOppSHtkLfL31RCyVvHTbrEDOef+NHjnPDTy5jxkhWpdy3L8H R84A== X-Gm-Message-State: AIkVDXIspKTNBaga+NUuL/qybBG792kTLMMtS4LzplQtKDKw7tq189+miaZ5dYMGK+FE0InSh/Gvd41WqE+aAg== X-Received: by 10.157.36.161 with SMTP id z30mr1409150ota.208.1484325070607; Fri, 13 Jan 2017 08:31:10 -0800 (PST) Original-Received: by 10.157.21.117 with HTTP; Fri, 13 Jan 2017 08:31:10 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: QnLGIkJfIeP7AAvoNRo24lrLrxE X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:132992 On Fri, Jan 13, 2017 at 1:14 AM, Tino Calancha 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.