From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12747: 23.4; diff-auto-refine-mode process only last hunk in diff (must ALL). Date: Sun, 28 Oct 2012 09:54:22 -0400 Message-ID: References: <87y5iqbxqn.fsf@gavenkoa.example.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1351432489 32639 80.91.229.3 (28 Oct 2012 13:54:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Oct 2012 13:54:49 +0000 (UTC) Cc: 12747@debbugs.gnu.org To: Oleksandr Gavenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 28 14:54:57 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TSTKH-0002gB-Mv for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Oct 2012 14:54:53 +0100 Original-Received: from localhost ([::1]:60035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSTK9-0008Dv-A0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Oct 2012 09:54:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSTK7-0008Dq-Dt for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2012 09:54:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TSTK6-0003EQ-05 for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2012 09:54:43 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSTK5-0003E4-Qt for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2012 09:54:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TSTMM-0005tM-00 for bug-gnu-emacs@gnu.org; Sun, 28 Oct 2012 09:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Oct 2012 13:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12747 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12747-submit@debbugs.gnu.org id=B12747.135143260722612 (code B ref 12747); Sun, 28 Oct 2012 13:57:01 +0000 Original-Received: (at 12747) by debbugs.gnu.org; 28 Oct 2012 13:56:47 +0000 Original-Received: from localhost ([127.0.0.1]:36674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TSTM6-0005sf-Li for submit@debbugs.gnu.org; Sun, 28 Oct 2012 09:56:46 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:12465) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TSTM4-0005sY-Nn for 12747@debbugs.gnu.org; Sun, 28 Oct 2012 09:56:45 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu0/O+LET/2dsb2JhbAA8CLQRgQiCFQEBBAFWIwULCzQSFBgNJIgcBboJhWWFOIUnA6MzgViDBQ X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="203016954" Original-Received: from 206-248-177-19.dsl.teksavvy.com (HELO pastel.home) ([206.248.177.19]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 28 Oct 2012 09:54:23 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 842A659415; Sun, 28 Oct 2012 09:54:22 -0400 (EDT) In-Reply-To: <87y5iqbxqn.fsf@gavenkoa.example.com> (Oleksandr Gavenko's message of "Sun, 28 Oct 2012 14:13:36 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66130 Archived-At: > If I enable diff-auto-refine-mode in all diff-mode buffers: > (defun my-diff-auto-refine-mode-on () (diff-auto-refine-mode 1)) > (add-hook 'diff-mode-hook 'my-diff-auto-refine-mode-on) > I see actions only on last hunk in diff. I'm not sure I understand what you mean. `diff-auto-refine-mode' does not refine-highlight all the hunks at once (quoting the docstring): When enabled, Emacs automatically highlights changes in detail as the user visits hunks. "as the user visits the hunks" means that it's only highlighted in response to "n" and "p" (and a few related operations). This is not a bug. IIUC you'd like the refinement to be done in any hunk that is ever displayed, right? If so, that is a valid request for enhancement, and I fully agree. If someone is interested in implementing it, here's how I think it would have to work: - add a font-lock-keywords rule in diff-mode which simply registers the region displayed in a buffer-local var `diff--regions-displayed'. - have an idle timer that checks `diff--regions-displayed' and refines all the hunks in those regions (and it should also font-lock those hunks at the same time, so that if some of the hunk is not yet displayed and not yet font-locked, displaying it later on won't cause re-refining the hunk). Stefan