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: Wed, 07 Sep 2016 00:14:56 -0700 Message-ID: <87oa4018r3.fsf@secretsauce.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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473232527 5220 195.159.176.226 (7 Sep 2016 07:15:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Sep 2016 07:15:27 +0000 (UTC) User-Agent: mu4e 0.9.17; emacs 25.1.1 Cc: Andreas Schwab , 17544@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 07 09:15:23 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 1bhX4p-0000Z9-R7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Sep 2016 09:15:20 +0200 Original-Received: from localhost ([::1]:38548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhX4n-0001Mu-Oi for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Sep 2016 03:15:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhX4e-0001Hc-TL for bug-gnu-emacs@gnu.org; Wed, 07 Sep 2016 03:15:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhX4a-0007eB-Ls for bug-gnu-emacs@gnu.org; Wed, 07 Sep 2016 03:15:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhX4Y-0007ds-AF for bug-gnu-emacs@gnu.org; Wed, 07 Sep 2016 03:15:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bhX4Y-00031X-6E for bug-gnu-emacs@gnu.org; Wed, 07 Sep 2016 03:15: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: Wed, 07 Sep 2016 07:15: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.147323250011599 (code B ref 17544); Wed, 07 Sep 2016 07:15:02 +0000 Original-Received: (at 17544) by debbugs.gnu.org; 7 Sep 2016 07:15:00 +0000 Original-Received: from localhost ([127.0.0.1]:51872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhX4W-000311-6H for submit@debbugs.gnu.org; Wed, 07 Sep 2016 03:15:00 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:54374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhX4V-00030u-Bh for 17544@debbugs.gnu.org; Wed, 07 Sep 2016 03:14:59 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id ED25D2037A; Wed, 7 Sep 2016 03:14:58 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Wed, 07 Sep 2016 03:14:59 -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=t2DoF AeI09uQvpN/Z4A7hiiDAks=; b=XK2kuFUizCg461FX3Ev7HjCtL9+UWtfZ/7ny5 wcs0L3dK150J/neP1H9TRTYWeSq/s6MbSSDtfF2zSsxaWoZwVnFbTXQEy/bslvO4 UPm+8ImxVJUgOFrtEJoz5thliP0pMgI3E/Rs1GEI1Or8zSoqXg2EIAyl1PToa0v2 9AMnaE= 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=t2DoFAeI09uQvpN/Z4A7hiiDAks=; b=taEr3 TWc6g4FqPgmeD7StyG6Ltlq/zEQcs58oikAlNLt38Ltwwsm9oazsKPNP5Db385jb cuhYznzBBeG1NYqEd45ODzNxalKoGmXdiJGf9y15mZCXk2aTN8XuHFDJsU5TKLpX y3mUuexD9zQxLdaJDjdNgApw5DAp7Ow6W/TuaE= X-Sasl-enc: qYJmKAXZUOoC5iO03sUp/f2phqocuEBx6t5onGDujhQp 1473232498 Original-Received: from scrawny (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 95CD8CCE75; Wed, 7 Sep 2016 03:14:58 -0400 (EDT) Original-Received: from [::1] (helo=scrawny) by scrawny with esmtp (Exim 4.87) (envelope-from ) id 1bhX4T-0002Xp-8S; Wed, 07 Sep 2016 00:14:57 -0700 In-reply-to: <87k2es9weh.fsf@users.sourceforge.net> 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:123048 Archived-At: npostavs@users.sourceforge.net writes: > Dima Kogan writes: > >> >>> 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. > > IMO, it would make more sense to just define your new commands directly, > something like: > > (defun diff-hunk-next-command (&optional count) > "." > (interactive "p") > (let ((start (point))) > (let ((hunk-bounds (diff-bounds-of-hunk))) > (goto-char (car hunk-bounds))) > (diff-hunk-next count) > (when (not (looking-at diff-hunk-header-re)) > (goto-char start) > (user-error "No next hunk")))) > > And then just give the *binding* of `diff-hunk-next' to > `diff-hunk-next-command'. No need to make a higher order wrapper > function just for defining 2 functions. I've no problems with this. If I address this and the other comments, we can talk about merging this? Thanks