From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation Date: Sun, 11 Dec 2016 23:28:13 -0800 Message-ID: <87fultr4he.fsf@secretsauce.net> References: <874m2q1oca.fsf@gmail.com> <4707af57-53ae-9b10-686a-1ca0864b9abb@yandex.ru> <87h96cr2su.fsf@secretsauce.net> <59e902d2-e8b4-63e3-f780-af24cdf50a74@yandex.ru> <9fe241fa-d4ee-6e44-bfdd-99cb6b4ab4e4@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481528203 685 195.159.176.226 (12 Dec 2016 07:36:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2016 07:36:43 +0000 (UTC) User-Agent: mu4e 0.9.17; emacs 26.0.50.1 Cc: Tino Calancha , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 12 08:36:39 2016 Return-path: Envelope-to: ged-emacs-devel@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 1cGLA7-0007fZ-5s for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2016 08:36:39 +0100 Original-Received: from localhost ([::1]:48187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGLA9-0006MM-FW for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2016 02:36:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGL25-0007Z7-Tu for emacs-devel@gnu.org; Mon, 12 Dec 2016 02:28:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGL21-0006PT-Vc for emacs-devel@gnu.org; Mon, 12 Dec 2016 02:28:21 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:60972) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cGL21-0006Ns-PW for emacs-devel@gnu.org; Mon, 12 Dec 2016 02:28:17 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8CE3920907; Mon, 12 Dec 2016 02:28:15 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 12 Dec 2016 02:28:15 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=uotjN3TjbpZ8aEl2tadpouFXw6M=; b=JV237t Af3dr2nNjohVfAEg8rdFrjfPyNSjuytX8Kqmxmo+yDDpKTm5tBwLfk7FIvcHS3tt Fz//Rfk8/xHfV/95FzwUftvOR9ELBLjd50RYqCg7tJVrEvfpih5bMjmPa6ZmSjXb Tyx1Pr8o/IxCOvMdevatbPYreelQm2KKJToww= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=uotjN3TjbpZ8aE l2tadpouFXw6M=; b=t390LakXJ3Brr3F40RlIzCtIQiO0R8Y5bWby/Cqh5vw/mR N/z9lFsgVbfPf+9eo9hxP2W/YD3tlhmEdR7ku6g9DR6uyZLzS1dtpSxxKa3KFb8K uB9aHgkiHQar0dHiYHcEx0cXgRbdfcWSne72aly7/7cq99tUi7AX3LAvHJE78= X-ME-Sender: X-Sasl-enc: 6L3AEb7IjA+c54XmKtcjlslOtSvfICdW1fXHyk6OvI7X 1481527695 Original-Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 4205D7EF6C; Mon, 12 Dec 2016 02:28:15 -0500 (EST) Original-Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1cGL1x-0000rz-P8; Sun, 11 Dec 2016 23:28:13 -0800 In-reply-to: <9fe241fa-d4ee-6e44-bfdd-99cb6b4ab4e4@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210331 Archived-At: Dmitry Gutov writes: > On 10.12.2016 19:27, Dima Kogan wrote: > >> For the other concerns, I can special-case the last hunk, and move to >> eob for diff-next, and to ding only if we're already at eob to begin >> with. Hi. I played around with this, and I now really don't like this idea because it would mean that diff-hunk-next no longer always moves to the next hunk. At the last hunk, diff-hunk-next would stay on the SAME hunk if this was implemented. It would really make more sense if - diff-hunk-next moves to next hunk - if this isn't possible, the point stays where it is, and an error is signalled This is what the behavior in git intends to do. Furthermore, I think invoking auto-refinement in diff-mode-hook makes sense. The auto-refinement logic is written (not by me) to auto-refine the hunk at point when it is visited. And this is triggered not just with functions such as diff-hunk-next but also with actions such as turning on auto-refine-mode: diff-auto-refine-mode refines the hunk at point. Given this, I think it makes sense for us to do what diff-auto-refine-mode does if we enter diff-mode and auto-refinement is already on. And I think that this should happen even if the first hunk is large. This would indeed be slow, but this is AUTO refinement. If you want to decide when refinement should or should not happen, auto-refinement is not what you want. We can add a variable to block auto-refinement for hunks larger than some size, which probably would be a good idea anyway. I fixed the incorrect behavior where auto-refinement was kicking in even when the navigation failed and we signalled an error. Not attaching any patches yet. Let's agree on an approach, and then talk implementation. dima