From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#17544: 24.3; [PATCH] Improved diff-mode navigation/manipulation Date: Mon, 14 Nov 2016 22:31:17 -0500 Message-ID: <87twb9l8qi.fsf@users.sourceforge.net> References: <87ha4jgw53.fsf@secretsauce.net> <87si0ion1c.fsf@gnus.org> <87k2et8hr4.fsf@secretsauce.net> <83a8fpe1dr.fsf@gnu.org> <87h99w8ynv.fsf@secretsauce.net> <87k2es9weh.fsf@users.sourceforge.net> <87oa4018r3.fsf@secretsauce.net> <87twdi6rm9.fsf@secretsauce.net> <87h997nkqp.fsf@secretsauce.net> <874m44tmge.fsf@users.sourceforge.net> <87h983rg9c.fsf@secretsauce.net> <87mvhvsrta.fsf@users.sourceforge.net> <87wpgge0kl.fsf@secretsauce.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1479180721 15389 195.159.176.226 (15 Nov 2016 03:32:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 Nov 2016 03:32:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: Andreas Schwab , 17544@debbugs.gnu.org To: Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 15 04:31:56 2016 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 1c6USm-0005Cw-TR for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Nov 2016 04:31:13 +0100 Original-Received: from localhost ([::1]:43922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6USl-0003kE-Bs for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Nov 2016 22:31:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6USf-0003k7-A0 for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 22:31:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6USc-00039d-7t for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 22:31:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42165) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c6USc-00039Z-53 for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 22:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c6USb-0005dc-QS for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 22:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Nov 2016 03:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17544 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 17544-submit@debbugs.gnu.org id=B17544.147918063621633 (code B ref 17544); Tue, 15 Nov 2016 03:31:01 +0000 Original-Received: (at 17544) by debbugs.gnu.org; 15 Nov 2016 03:30:36 +0000 Original-Received: from localhost ([127.0.0.1]:57564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6USC-0005cr-JA for submit@debbugs.gnu.org; Mon, 14 Nov 2016 22:30:36 -0500 Original-Received: from mail-it0-f68.google.com ([209.85.214.68]:33877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6USA-0005ce-Oa for 17544@debbugs.gnu.org; Mon, 14 Nov 2016 22:30:35 -0500 Original-Received: by mail-it0-f68.google.com with SMTP id q124so19185497itd.1 for <17544@debbugs.gnu.org>; Mon, 14 Nov 2016 19:30:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=LqHHxQg1l/iBxYwZ9LKEDFnIOjY5vQ59KBKTHUxX8rs=; b=M0zfpqJo68xpE/gf2t/d5wMg0G0P+FsVlPUMWlJ/qoWKyaneREMh3kVoSi0u0D8JaT uTldthcM7cJnmjdv9ltU9ap6vW+OJ0uTsca8YYfltUJCrKlUBtZ2Wf+WJAt6MzwoRsYw jdwUmgOV+SrQuPDSnaEcUSlur0cSoHruLgSEk/AyBeTOZ3qZc3xyge6bEOVssAkCnbZq fFbSGKaUds5LMmIomtr87nXrBf2TrleH0UtjFdEac4g9KM2uFQ8I7apPO7q4i9/hG7Kq dolcHxb3/91DnHHkXlxL58ZRERQBHlb5SWUqcsiuaRv1aiE1CqccLIDlVA61SO2e1x5d iEIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=LqHHxQg1l/iBxYwZ9LKEDFnIOjY5vQ59KBKTHUxX8rs=; b=FcSRaVH1BbbghrPH/9wb+jQmUQUoDX6f+t7csTkNcjE6RtOkeFpwnALbO5VgthhW3M 5Rab4ZTb319g3jmaTIeSqAdDjjXm94eRJGo9ZHjoX9ftJUGR+J1cLB+0ruNX416snTML CQY4dikoSgeSxMI1Yk01hR4VLyMYq9y/I7QXvNErOa5YDitR1BJ/Az2Q4+KKIkhvf6Ia Yy3x25DvUkn6VsOWhbbdRvOH/R/Znd1dCBD+eo6yUDkTgCQnmKeuqdu5tavJWd/jkOum HXYwJmQd1DEJt+B6T7D+cjM4rEFR58YkPD/YGbOG7TVap/nl+pIRsOV6YTp6tdr5122u JvpA== X-Gm-Message-State: ABUngvc6Y01mxqULhpJL/pYMwJLlXxqpTJlXFcHUIC603jKtp2G0X99Xz+dwBPkzM+W2hw== X-Received: by 10.107.199.66 with SMTP id x63mr28710260iof.97.1479180629130; Mon, 14 Nov 2016 19:30:29 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id t129sm10670290iod.11.2016.11.14.19.30.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Nov 2016 19:30:28 -0800 (PST) In-Reply-To: <87wpgge0kl.fsf@secretsauce.net> (Dima Kogan's message of "Sun, 06 Nov 2016 18:26:54 -0800") 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:125706 Archived-At: Dima Kogan writes: > npostavs@users.sourceforge.net writes: > >> Dima Kogan writes: >> >>> Hi. I'm open to suggestions. The goal was to retain the previous logic >>> for any existing code, but to provide improved user-facing behavior. > > Ack! So this is what happens when you submit a patch, and then talk > about it more than 2 years later. Turns out preserving compatibility > with existing code wasn't my goal at all. Rather, the goal was to avoid > an infinite loop that results if (diff-hunk-next) unconditionally uses > the new logic: > > diff-hunk-next calls > diff--wrap-navigation calls > diff-bounds-of-hunk calls > diff-beginning-of-hunk calls > diff-hunk-next > > Revised patch attached. I'll try to respond to any comments > quickly so that we all can remember what this is about. [...] > - (t (error "No hunk found")))))) > + ;; There's no next hunk, so just take the one we have > + (t (list beg end)))))) Indentation on the comment looks a bit off. > + > + ;; I advance to the next hunk interactively because I want the > + ;; interactive behavior of moving to the next logical hunk, not > + ;; the legacy behavior where were would sometimes sty on the > + ;; curent hunk. See http://debbugs.gnu.org/17544 > (when diff-advance-after-apply-hunk > - (diff-hunk-next)))))) > + (diff-hunk-next nil t)))))) Updating the comment here will be useful for the next person trying to figure out what this is all about in a couple more years. > (hunk (delete-and-extract-region > - (point) (save-excursion (diff-end-of-hunk) (point)))) > + (point) (cadr hunk-bounds))) Indentation looks off here.