From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#17544: 24.3; [PATCH] Improved diff-mode navigation/manipulation Date: Sat, 03 Sep 2016 14:24:20 -0700 Message-ID: <87h99w8ynv.fsf@secretsauce.net> References: <87ha4jgw53.fsf@secretsauce.net> <87si0ion1c.fsf@gnus.org> <87k2et8hr4.fsf@secretsauce.net> <83a8fpe1dr.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1472937931 19412 195.159.176.226 (3 Sep 2016 21:25:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Sep 2016 21:25:31 +0000 (UTC) User-Agent: mu4e 0.9.17; emacs 25.1.1 Cc: Andreas Schwab , 17544@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 03 23:25:27 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 1bgIRF-0003uR-Ay for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Sep 2016 23:25:21 +0200 Original-Received: from localhost ([::1]:47913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgIRC-0006QX-WE for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Sep 2016 17:25:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgIR5-0006Lv-1F for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2016 17:25:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgIQz-0001Yn-0c for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2016 17:25:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgIQw-0001XB-O4 for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2016 17:25:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bgIQw-0004Py-Gf for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2016 17:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Sep 2016 21:25:02 +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.147293786516931 (code B ref 17544); Sat, 03 Sep 2016 21:25:02 +0000 Original-Received: (at 17544) by debbugs.gnu.org; 3 Sep 2016 21:24:25 +0000 Original-Received: from localhost ([127.0.0.1]:49002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgIQL-0004P1-L0 for submit@debbugs.gnu.org; Sat, 03 Sep 2016 17:24:25 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgIQJ-0004Os-6x for 17544@debbugs.gnu.org; Sat, 03 Sep 2016 17:24:24 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B22E3202A9; Sat, 3 Sep 2016 17:24:22 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Sat, 03 Sep 2016 17:24:22 -0400 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-sasl-enc:x-sasl-enc; s=mesmtp; bh=DU5xz ZpBL5AxaCA3xXSsQ0AjSZM=; b=p7Ff19RN+DDgeUjWM84mvC98fNRs4VpfQaKx5 ci+dM7U7TlG88sQ/jA5aqHNJWR9JHyBqfIbnKsEN5ttWs3HVDjHF8kRaNENWqvZa Wo8+JOGMCYaPs4v1RAx5o/gcqupW/QGMBX+dKkhWzM2K5wafaWMHND1Joa3N69X0 bYEmzQ= 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-sasl-enc :x-sasl-enc; s=smtpout; bh=DU5xzZpBL5AxaCA3xXSsQ0AjSZM=; b=WFulU X19HzONrWlt2mMVSzJzNavaifEzbr1BWKpRXHoWw2LO2cnmGJ6l3LJo1ssfZCvxS ClMzUDgaczuO1wUMXlSkyIxyRTbodq/78JJ9j+7wHdTN7KyQdLUr1txP/xQI4APl tNS0RBQa5NpJ9evNZW8bV5GokTlAYiPvOsDoDA= X-Sasl-enc: uVQ1tfjn+4UWryisJycgMC9tkGKBFhlfhFyedEgFouow 1472937862 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 4E9B7CCE81; Sat, 3 Sep 2016 17:24:22 -0400 (EDT) Original-Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1bgIQG-00064a-Mu; Sat, 03 Sep 2016 14:24:20 -0700 In-reply-to: <83a8fpe1dr.fsf@gnu.org> 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:122913 Archived-At: I'd like to get high-level consensus before making any changes. So ... Eli Zaretskii writes: > Regardless, the doc string of diff--wrap-hunk-navigation is not > according to our coding style, so please fix it. OK. > Also, I don't quite understand why you need changes like this one: > > - (diff-hunk-next)))))) > + (call-interactively 'diff-hunk-next)))))) It's been quite a while since I wrote this, and looking at it just now I can't tell why this is necessary. So let's say one can take out this hunk > and the whole issue of testing called-interactively-p that goes with > it. Can you explain? I'm guessing the interactivity checking in diff-hunk-next and diff-hunk-prev was intended to keep scripts working as before. Again, it has been too long to remember specifically. Andreas Schwab writes: > On Mai 21 2014, Dima Kogan wrote: > >> +(setq diff--hunk-prev-internal (symbol-function 'diff-hunk-prev)) >> +(defun diff-hunk-prev (&optional count) > > This will break if diff-mode is reloaded. Will it? diff-hunk-next and -prev are defined just above in the (easy-mmode-define-navigation diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view block. If one reloads diff-mode, wouldn't this easy-mmode-define-navigation block define the old diff-hunk-prev, which then gets redefined by the code in the patch? It would be nicer to define these functions properly the first time instead of (effectively) advising them. But (easy-mmode-define-navigation) allows arbitrary code to be called after the template, but I need new stuff BEFORE it. Better ideas welcome. dima