From unknown Thu Aug 14 17:30:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18128 <18128@debbugs.gnu.org> To: bug#18128 <18128@debbugs.gnu.org> Subject: Status: Diff-mode doesn't refine hunks automatically Reply-To: bug#18128 <18128@debbugs.gnu.org> Date: Fri, 15 Aug 2025 00:30:01 +0000 retitle 18128 Diff-mode doesn't refine hunks automatically reassign 18128 emacs submitter 18128 Paul Pogonyshev severity 18128 wishlist tag 18128 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 09:59:34 2014 Received: (at submit) by debbugs.gnu.org; 28 Jul 2014 13:59:34 +0000 Received: from localhost ([127.0.0.1]:40873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBlSb-0003jp-2i for submit@debbugs.gnu.org; Mon, 28 Jul 2014 09:59:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35605) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBlST-0003jW-54 for submit@debbugs.gnu.org; Mon, 28 Jul 2014 09:59:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBlSN-0003MS-5z for submit@debbugs.gnu.org; Mon, 28 Jul 2014 09:59:15 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBlSN-0003MO-3D for submit@debbugs.gnu.org; Mon, 28 Jul 2014 09:59:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBlSM-0000w6-9W for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 09:59:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBlSL-0003M5-Fv for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 09:59:14 -0400 Received: from mail-oa0-x234.google.com ([2607:f8b0:4003:c02::234]:54470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBlSL-0003M1-Af for bug-gnu-emacs@gnu.org; Mon, 28 Jul 2014 09:59:13 -0400 Received: by mail-oa0-f52.google.com with SMTP id o6so8748882oag.11 for ; Mon, 28 Jul 2014 06:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=XVhmVsO+je7oh+tjTSFepH8t9ZpoA5ut3RHUEECezEc=; b=s+age0O1VkLqgh4iYqrcbGPd1lD9N6+/D9HF9kDF2gqX7AknvlGE/TkTBQvc1fxTJJ cTJUHGdOWhM19T9u1c8KP4u54Mt4M6WnHewQq5LHA+mWRMDs9w0yzDHwXF64JqEiXPNR l1qYYsiggV/6ITeOr4uq+SYSbdKhkoUCT9+4lkHWbhYJgJGis08Jm6T4yzGqfDRJMnRi Ds9w/+1YtiLse++2Pc4VvJr9HRNprptoaXyvqp41TTqR/UMUDEw54uvmlpTucbuxf5Hg GyT0CXUQg4OvdYE02g+dJ5vEj2LBqwfE3XfUcGr8vydM7qLErU4+zYSfQUN5Sh2CfwNb GhUQ== MIME-Version: 1.0 X-Received: by 10.182.24.101 with SMTP id t5mr50434028obf.66.1406555952365; Mon, 28 Jul 2014 06:59:12 -0700 (PDT) Received: by 10.182.162.67 with HTTP; Mon, 28 Jul 2014 06:59:12 -0700 (PDT) Date: Mon, 28 Jul 2014 15:59:12 +0200 Message-ID: Subject: Diff-mode doesn't refine hunks automatically From: Paul Pogonyshev To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=001a11c2a1d4e5d16604ff415386 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a11c2a1d4e5d16604ff415386 Content-Type: text/plain; charset=UTF-8 Diff-mode should just refine hunks automatically when visiting a buffer. If it is a performance concern, there should be some customization option for it and/or this could be done lazily. Chunk refining is just too useful to not have. Paul --001a11c2a1d4e5d16604ff415386 Content-Type: text/html; charset=UTF-8
Diff-mode should just refine hunks automatically when visiting a buffer. If it is a performance concern, there should be some customization option for it and/or this could be done lazily.

Chunk refining is just too useful to not have.

Paul
--001a11c2a1d4e5d16604ff415386-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 10:28:04 2014 Received: (at 18128) by debbugs.gnu.org; 28 Jul 2014 14:28:04 +0000 Received: from localhost ([127.0.0.1]:40891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBluF-0004Re-VX for submit@debbugs.gnu.org; Mon, 28 Jul 2014 10:28:04 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:40091) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBluD-0004R8-41 for 18128@debbugs.gnu.org; Mon, 28 Jul 2014 10:28:02 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0N9F00200EK7LO00@a-mtaout23.012.net.il> for 18128@debbugs.gnu.org; Mon, 28 Jul 2014 17:27:54 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9F0028HEUHM300@a-mtaout23.012.net.il>; Mon, 28 Jul 2014 17:27:54 +0300 (IDT) Date: Mon, 28 Jul 2014 17:28:09 +0300 From: Eli Zaretskii Subject: Re: bug#18128: Diff-mode doesn't refine hunks automatically In-reply-to: X-012-Sender: halo1@inter.net.il To: Paul Pogonyshev Message-id: <83d2cph81y.fsf@gnu.org> References: X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18128 Cc: 18128@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Mon, 28 Jul 2014 15:59:12 +0200 > From: Paul Pogonyshev > > Diff-mode should just refine hunks automatically when visiting a buffer. If > it is a performance concern, there should be some customization option for > it and/or this could be done lazily. > > Chunk refining is just too useful to not have. Why isn't diff-auto-refine-mode enough? From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 10:40:17 2014 Received: (at 18128) by debbugs.gnu.org; 28 Jul 2014 14:40:17 +0000 Received: from localhost ([127.0.0.1]:40903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBm60-0004n2-H6 for submit@debbugs.gnu.org; Mon, 28 Jul 2014 10:40:16 -0400 Received: from mail-oa0-f51.google.com ([209.85.219.51]:42185) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBm5q-0004mI-LR for 18128@debbugs.gnu.org; Mon, 28 Jul 2014 10:40:07 -0400 Received: by mail-oa0-f51.google.com with SMTP id o6so8779989oag.38 for <18128@debbugs.gnu.org>; Mon, 28 Jul 2014 07:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MWT6m4kWnAPms77KvTo85LBiTzRgI781rfB2+EVqtSw=; b=hmnmnYlQX+tOvmW6SC59FrKqWfFowDcXjTjl7WHxeQvLVlQjGnQDGGDLVH95SFrJjQ MbxaPhcIQ2G9C3wDylQSCvwSQ++dc/H8rwwWqwNG9WTYFCZ2ewauKHFBUuZckh3jp/rP elAKwo+0iWTDoAaXPf1jq7X71fx/3/lzSgi1dx4QuGQ/V6BJnjhzZqzcMre03dhdxsqR lwTA96PZVRT91eCgY17QiP1Pbl7YmRoX235+mWc8i5rzhl75RfkigRGrKdgxx0DZyQW/ hQ98Eduvm/FtxG23YIVPPdUv69UZnRlO4zlHJ8vmu573XHcO0NhO9ec51n0ay8AI7lTF PuJA== MIME-Version: 1.0 X-Received: by 10.182.18.69 with SMTP id u5mr49436595obd.54.1406558396811; Mon, 28 Jul 2014 07:39:56 -0700 (PDT) Received: by 10.182.162.67 with HTTP; Mon, 28 Jul 2014 07:39:56 -0700 (PDT) In-Reply-To: <83d2cph81y.fsf@gnu.org> References: <83d2cph81y.fsf@gnu.org> Date: Mon, 28 Jul 2014 16:39:56 +0200 Message-ID: Subject: Re: bug#18128: Diff-mode doesn't refine hunks automatically From: Paul Pogonyshev To: Eli Zaretskii Content-Type: multipart/alternative; boundary=001a11c338aa99111504ff41e53f X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18128 Cc: 18128@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c338aa99111504ff41e53f Content-Type: text/plain; charset=UTF-8 It is enough. Then please add a reference to it to documentation of diff-refine-hunk, I wasn't even aware of that mode. Paul On 28 July 2014 16:28, Eli Zaretskii wrote: > > Date: Mon, 28 Jul 2014 15:59:12 +0200 > > From: Paul Pogonyshev > > > > Diff-mode should just refine hunks automatically when visiting a buffer. > If > > it is a performance concern, there should be some customization option > for > > it and/or this could be done lazily. > > > > Chunk refining is just too useful to not have. > > Why isn't diff-auto-refine-mode enough? > --001a11c338aa99111504ff41e53f Content-Type: text/html; charset=UTF-8
It is enough. Then please add a reference to it to documentation of diff-refine-hunk, I wasn't even aware of that mode.

Paul


On 28 July 2014 16:28, Eli Zaretskii <eliz@gnu.org> wrote:
> Date: Mon, 28 Jul 2014 15:59:12 +0200
> From: Paul Pogonyshev <pogonyshev@gmail.com>
>
> Diff-mode should just refine hunks automatically when visiting a buffer. If
> it is a performance concern, there should be some customization option for
> it and/or this could be done lazily.
>
> Chunk refining is just too useful to not have.

Why isn't diff-auto-refine-mode enough?

--001a11c338aa99111504ff41e53f-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 10:44:31 2014 Received: (at 18128) by debbugs.gnu.org; 28 Jul 2014 14:44:31 +0000 Received: from localhost ([127.0.0.1]:40907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBmAA-0004tl-Fy for submit@debbugs.gnu.org; Mon, 28 Jul 2014 10:44:30 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:43754) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBmA7-0004tV-3m for 18128@debbugs.gnu.org; Mon, 28 Jul 2014 10:44:28 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0N9F00100FFG8L00@mtaout26.012.net.il> for 18128@debbugs.gnu.org; Mon, 28 Jul 2014 17:40:46 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9F00INCFFXQU70@mtaout26.012.net.il>; Mon, 28 Jul 2014 17:40:46 +0300 (IDT) Date: Mon, 28 Jul 2014 17:44:36 +0300 From: Eli Zaretskii Subject: Re: bug#18128: Diff-mode doesn't refine hunks automatically In-reply-to: X-012-Sender: halo1@inter.net.il To: Paul Pogonyshev Message-id: <83bns9h7aj.fsf@gnu.org> References: <83d2cph81y.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18128 Cc: 18128@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Mon, 28 Jul 2014 16:39:56 +0200 > From: Paul Pogonyshev > Cc: 18128@debbugs.gnu.org > > It is enough. Then please add a reference to it to documentation of > diff-refine-hunk, I wasn't even aware of that mode. It is currently mentioned there as follows: `M-n' Move to the next hunk-start (`diff-hunk-next'). This command has a side effect: it "refines" the hunk you move to, highlighting its changes with better granularity. To disable this feature, type `M-x diff-auto-refine-mode' to toggle off the minor mode Diff Auto-Refine mode. To disable Diff Auto Refine mode by default, add this to your init file (*note Hooks::): (add-hook 'diff-mode-hook (lambda () (diff-auto-refine-mode -1))) If you think this is not enough, please tell what else would you like to see there about this minor mode. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 10:45:48 2014 Received: (at 18128) by debbugs.gnu.org; 28 Jul 2014 14:45:48 +0000 Received: from localhost ([127.0.0.1]:40911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBmBP-0004w5-Fg for submit@debbugs.gnu.org; Mon, 28 Jul 2014 10:45:47 -0400 Received: from mail-oa0-f46.google.com ([209.85.219.46]:65465) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBmBN-0004vr-0E for 18128@debbugs.gnu.org; Mon, 28 Jul 2014 10:45:45 -0400 Received: by mail-oa0-f46.google.com with SMTP id m1so8762746oag.5 for <18128@debbugs.gnu.org>; Mon, 28 Jul 2014 07:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sWv+WWR6SPLLH90hy9z5OpuRWbC89yxagobVUsY+DCg=; b=06oervEBNmDes+0myQPiAPpNHlNnXtxgNzLKuYvvN7WtImEkuS7Rs0s4aOcIZH6eSA 1DpK9beS2h0DuQTN78XyC2JB9GfjGX+IXjvcBNCQxr16LP20G6co5AqA5f6yD/CjMETi pjDgZHgysxyK49VU+Xbw33AHQmeRznrR7DOonHAFKBDz8Dl4QHK2xYYXNyGMKeCG2ISo +3Ia3cjG/TjnNWu7bFUoSjO+QaS2KCfc5MX051TFfqmcgdWj/XWEueTxLT0GafJah+m1 GbmYZ6CSSpXGxOT0xruvdKWMOaYBmrwAcSypPQsGbiZPVDyQNPCA8oLJwQaOyXQEB1Pv cm1Q== MIME-Version: 1.0 X-Received: by 10.60.133.233 with SMTP id pf9mr50598472oeb.30.1406558739314; Mon, 28 Jul 2014 07:45:39 -0700 (PDT) Received: by 10.182.162.67 with HTTP; Mon, 28 Jul 2014 07:45:39 -0700 (PDT) In-Reply-To: References: <83d2cph81y.fsf@gnu.org> Date: Mon, 28 Jul 2014 16:45:39 +0200 Message-ID: Subject: Re: bug#18128: Diff-mode doesn't refine hunks automatically From: Paul Pogonyshev To: Eli Zaretskii Content-Type: multipart/alternative; boundary=047d7b472078033b8404ff41fa36 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18128 Cc: 18128@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --047d7b472078033b8404ff41fa36 Content-Type: text/plain; charset=UTF-8 Actually, it seems it is not enough. My usecase: I open a fairly large diff file with many changes like -bla bla bla a long line were some word was changed or maybe two +bla bla bla a long line where some word was changed or maybe two I want to be able to immediately see the changes, without reading whole lines and certainly without visiting the hunks. When Emacs highlights the change (there is only one above), I see it right away. Otherwise I have to scan the lines with my eyes, which is tedious and error-prone. Of course I can also hit C-c C-b on each hunk, but it feels like some sort of work I'd prefer Emacs do for me. Paul On 28 July 2014 16:39, Paul Pogonyshev wrote: > It is enough. Then please add a reference to it to documentation of > diff-refine-hunk, I wasn't even aware of that mode. > > Paul > > > On 28 July 2014 16:28, Eli Zaretskii wrote: > >> > Date: Mon, 28 Jul 2014 15:59:12 +0200 >> > From: Paul Pogonyshev >> > >> > Diff-mode should just refine hunks automatically when visiting a >> buffer. If >> > it is a performance concern, there should be some customization option >> for >> > it and/or this could be done lazily. >> > >> > Chunk refining is just too useful to not have. >> >> Why isn't diff-auto-refine-mode enough? >> > > --047d7b472078033b8404ff41fa36 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Actually, it seems it is not enough. My use= case: I open a fairly large diff file with many changes like

-= bla bla bla a long line were some word was changed or maybe two
+bla bla= bla a long line where some word was changed or maybe two

I want to be able to immediately see the changes, without reading= whole lines and certainly without visiting the hunks. When Emacs highlight= s the change (there is only one above), I see it right away. Otherwise I ha= ve to scan the lines with my eyes, which is tedious and error-prone. Of cou= rse I can also hit C-c C-b on each hunk, but it feels like some sort of wor= k I'd prefer Emacs do for me.

Paul


On 28 July 2014 16:39, Paul Pogonyshev <pogonyshev@gmail.com= > wrote:
It is enough. Then ple= ase add a reference to it to documentation of diff-refine-hunk, I wasn'= t even aware of that mode.
Paul=


On 28 July 2014 16:28, Eli Zaretskii <eliz@gnu.org> wrote:
> Date: Mon, 28 Jul 2014 15:59:12 +0200
> From: Paul Pogonyshev <pogonyshev@gmail.com>
>
> Diff-mode should just refine hunks automatically when visiting a buffe= r. If
> it is a performance concern, there should be some customization option= for
> it and/or this could be done lazily.
>
> Chunk refining is just too useful to not have.

Why isn't diff-auto-refine-mode enough?


--047d7b472078033b8404ff41fa36-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 10:49:52 2014 Received: (at 18128) by debbugs.gnu.org; 28 Jul 2014 14:49:53 +0000 Received: from localhost ([127.0.0.1]:40915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBmFI-00051x-Eu for submit@debbugs.gnu.org; Mon, 28 Jul 2014 10:49:52 -0400 Received: from mail-oa0-f49.google.com ([209.85.219.49]:58474) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBmFC-00051f-H8 for 18128@debbugs.gnu.org; Mon, 28 Jul 2014 10:49:46 -0400 Received: by mail-oa0-f49.google.com with SMTP id eb12so8668715oac.8 for <18128@debbugs.gnu.org>; Mon, 28 Jul 2014 07:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=51HyWStphBCoEeqOjfAJwFSPu/xtJGkNCWxtElL/iNQ=; b=Btst8hnH0XQiGuzz7ffWk465SsEC21gk3AigiBUI3krqAwHZ/95sn30rrR3ynrTQNt sQ30hySg/PsMBFo49ds8LjzjvcfoJNFG9KASll/OXdYuYOWyiuYUph5BLvI+3s/avJz/ fJPc28JnIo0QH/brAu1YIw89ri4hCPzG/FEYCSdIQjU6j3ZwvtN0ydCvDOT2Kj9Ys0/m OqYWOxqnOo0f1aObH9Onrf9SYsx4gdldqTJyE4g1WbXhKqvOzhE7U1V0Y3jb6/dX3tDV YXm/KdIG5XZHhtsDMx4HW6/2W1pz0/7WpO6aXNj/A4kOJKMqYVqAFBpLhRoECjdZ4PCu 8vQQ== MIME-Version: 1.0 X-Received: by 10.182.28.66 with SMTP id z2mr50818301obg.19.1406558976896; Mon, 28 Jul 2014 07:49:36 -0700 (PDT) Received: by 10.182.162.67 with HTTP; Mon, 28 Jul 2014 07:49:36 -0700 (PDT) In-Reply-To: <83bns9h7aj.fsf@gnu.org> References: <83d2cph81y.fsf@gnu.org> <83bns9h7aj.fsf@gnu.org> Date: Mon, 28 Jul 2014 16:49:36 +0200 Message-ID: Subject: Re: bug#18128: Diff-mode doesn't refine hunks automatically From: Paul Pogonyshev To: Eli Zaretskii Content-Type: multipart/alternative; boundary=089e0158b09e2c72dc04ff420879 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18128 Cc: 18128@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --089e0158b09e2c72dc04ff420879 Content-Type: text/plain; charset=UTF-8 I'd like hunks to be refined regardless of the way I move around the file. E.g. if I chose to page-up through uninteresting parts of the diff, auto-refinining shouldn't stop. Paul On 28 July 2014 16:44, Eli Zaretskii wrote: > > Date: Mon, 28 Jul 2014 16:39:56 +0200 > > From: Paul Pogonyshev > > Cc: 18128@debbugs.gnu.org > > > > It is enough. Then please add a reference to it to documentation of > > diff-refine-hunk, I wasn't even aware of that mode. > > It is currently mentioned there as follows: > > `M-n' > Move to the next hunk-start (`diff-hunk-next'). > > This command has a side effect: it "refines" the hunk you move to, > highlighting its changes with better granularity. To disable this > feature, type `M-x diff-auto-refine-mode' to toggle off the minor > mode Diff Auto-Refine mode. To disable Diff Auto Refine mode by > default, add this to your init file (*note Hooks::): > > (add-hook 'diff-mode-hook > (lambda () (diff-auto-refine-mode -1))) > > If you think this is not enough, please tell what else would you like > to see there about this minor mode. > --089e0158b09e2c72dc04ff420879 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I'd like hunks to be refined regardless of the wa= y I move around the file. E.g. if I chose to page-up through uninteresting = parts of the diff, auto-refinining shouldn't stop.

Paul


On 28 J= uly 2014 16:44, Eli Zaretskii <eliz@gnu.org> wrote:
> Date: Mon, 28 Jul 2014 16:39:56 +0200
> From: Paul Pogonyshev <pogo= nyshev@gmail.com>
> Cc: 18128@debbugs.gnu.org=
>
> It is enough. Then please add a reference to it to documentation of > diff-refine-hunk, I wasn't even aware of that mode.

It is currently mentioned there as follows:

=C2=A0 =C2=A0`M-n'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Move to the next hunk-start (`diff-hunk-next= 9;).

=C2=A0 =C2=A0 =C2=A0 =C2=A0 This command has a side effect: it "refine= s" the hunk you move to,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 highlighting its changes with better granularit= y. =C2=A0To disable this
=C2=A0 =C2=A0 =C2=A0 =C2=A0 feature, type `M-x diff-auto-refine-mode' t= o toggle off the minor
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mode Diff Auto-Refine mode. =C2=A0To disable Di= ff Auto Refine mode by
=C2=A0 =C2=A0 =C2=A0 =C2=A0 default, add this to your init file (*note Hook= s::):

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(add-hook 'diff-mode-ho= ok
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(lambda () (diff-auto-refine-mode -1)))

If you think this is not enough, please tell what else would you like
to see there about this minor mode.

--089e0158b09e2c72dc04ff420879-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 28 19:28:25 2014 Received: (at 18128) by debbugs.gnu.org; 28 Jul 2014 23:28:25 +0000 Received: from localhost ([127.0.0.1]:41431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBuLB-0003Oh-13 for submit@debbugs.gnu.org; Mon, 28 Jul 2014 19:28:25 -0400 Received: from smtp-pri-02-2.vtxnet.net ([212.147.62.156]:50987 helo=smtp-pri-02.vtxnet.net) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBuL8-0003OX-OO for 18128@debbugs.gnu.org; Mon, 28 Jul 2014 19:28:23 -0400 Received: from fmsmemgm.homelinux.net (dyn.83-228-141-040.dsl.vtx.ch [83.228.141.40]) by smtp-pri-02.vtxnet.net (VTX Services SA) with ESMTP id 783EB37DCCD; Tue, 29 Jul 2014 01:28:21 +0200 (CEST) Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 47B09AE14E; Mon, 28 Jul 2014 19:28:21 -0400 (EDT) From: Stefan Monnier To: Paul Pogonyshev Subject: Re: bug#18128: Diff-mode doesn't refine hunks automatically Message-ID: References: Date: Mon, 28 Jul 2014 19:28:21 -0400 In-Reply-To: (Paul Pogonyshev's message of "Mon, 28 Jul 2014 15:59:12 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18128 Cc: 18128@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Diff-mode should just refine hunks automatically when visiting a buffer. If > it is a performance concern, there should be some customization option for > it and/or this could be done lazily. Agreed, it should be done "as part of font-locking". Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 17 01:22:51 2016 Received: (at 18128) by debbugs.gnu.org; 17 Jan 2016 06:22:51 +0000 Received: from localhost ([127.0.0.1]:51433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKgjj-0001J0-GI for submit@debbugs.gnu.org; Sun, 17 Jan 2016 01:22:51 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:25351) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKgjh-0001Ir-IJ for 18128@debbugs.gnu.org; Sun, 17 Jan 2016 01:22:50 -0500 Received: from [192.168.88.88] (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1453011766993500.46993785553; Sat, 16 Jan 2016 22:22:46 -0800 (PST) To: 18128@debbugs.gnu.org From: Hong Xu Subject: Should be done as part of the font-lock Message-ID: <569B3335.9020106@topbug.net> Date: Sat, 16 Jan 2016 22:22:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XU6D9qdPxj27m1X7tlqw13N3KMdKW9gJ7" X-Zoho-Virus-Status: 1 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 18128 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XU6D9qdPxj27m1X7tlqw13N3KMdKW9gJ7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I agree that this should be done as part of the font-lock. This issue not only causes inconvenience, but also causes bug #21990, which does not allow htmlfontify to correctly display the highlighting. Hong --XU6D9qdPxj27m1X7tlqw13N3KMdKW9gJ7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWmzM2AAoJECZsfTOCL4R4HF8P/05rSsGf6vCTg1jTkbx/k18f gw5XPu6rHp9KfR4U/UA1FnE7/G12MCo/tX4PkBPKP3RSHU97iV7RhNccxy/0+WOu dIcV9+aotFbxdNrYKZR/JLNe5s1rGQidEJauIiDHeB+s630zLKCqUHg2yxx/yQ3t Is8VciIOk+wAgoIh11ovjXbvqEWYxZsgO1W7U1i3luKos1Y6bb5i8ihoUKLR1JTD dFAFOOLSlZM/ZGO4phH36W3K6NvLYb91hXA+5idbARATGdgAzSiAKDq3ympD8Z8C g9+Y31cQ2qR5/OgaragnvpN/JCIRYZxaJWngAPyN/0cRaPJzPeTU3SVwWuqYxMu4 HB83z7jeRXERBPzukP7Gwasvm+BAmmtXjBsg1G5J1Zbxk+Z9FP4pTTdc7T8aCJsL xrauFLARYSKQ1gfu+QBvWTqhd5jDSG1U9hTDzmG1yel4paVZOrCEfpdiME53ATWN mwkF96cipGep66JacETTLvWaLHc2jfSXHUJnCna5kYgl4LegtUyfhtYpWVUhgT4o 8pm1AtZrD9cJkufiVTnfKQV6IpMl8Pw7JwIyX3hwLBf4kiuN+ZpQhDXKwwRsP2yu WDEfP8wiu0oI3zbxB2F8IgIwWNhcPzZU3gVBSt+egyCRswg3FQN7sdPB7J9rLufW 2BNBsfWbwLELC5iAp2sx =6e2u -----END PGP SIGNATURE----- --XU6D9qdPxj27m1X7tlqw13N3KMdKW9gJ7-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 03:54:25 2016 Received: (at 18128) by debbugs.gnu.org; 4 Nov 2016 07:54:25 +0000 Received: from localhost ([127.0.0.1]:42908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2ZKS-00089c-SE for submit@debbugs.gnu.org; Fri, 04 Nov 2016 03:54:25 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:21478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2ZKR-00089U-D5 for 18128@debbugs.gnu.org; Fri, 04 Nov 2016 03:54:23 -0400 Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1478246059204532.0343143650495; Fri, 4 Nov 2016 00:54:19 -0700 (PDT) References: <569B3335.9020106@topbug.net> User-agent: mu4e 0.9.17; emacs 25.1.50.3 From: Hong Xu To: 18128@debbugs.gnu.org Subject: Re: Should be done as part of the font-lock In-reply-to: <569B3335.9020106@topbug.net> Date: Fri, 04 Nov 2016 00:54:17 -0700 Message-ID: <87y40zwuhi.fsf@topbug.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Zoho-Virus-Status: 1 X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 18128 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) --=-=-= Content-Type: text/plain I currently use the following to do auto refining: (modified from http://emacs.stackexchange.com/a/28321/2755 ) (defun my-diff-refine-all () "Refine all diffs." (interactive) (save-excursion (goto-char (point-min)) (ignore-errors (diff-beginning-of-hunk t)) (ignore-errors (while (not (eobp)) (diff-refine-hunk) (diff-hunk-next))))) (defun my-diff-hunks-highlight-all () "Highlight all hunks in diff-mode." (add-hook 'font-lock-mode-hook #'my-diff-refine-all t t)) (add-hook 'diff-mode-hook 'my-diff-hunks-highlight-all) Not sure whether it is possible to merge into Emacs after some adjustment. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYHD6pAAoJECZsfTOCL4R4Uc0P/jPng4NjD/GaYM4orO0OTxVg PiVMNAY5Bytu/MBQLOJ91J7h6ACXmZLDguYgD4gNe6aaBgRYyJ98/V/b5Ohnlshr /VctXNfiJXRuHYo5pL/uH0T7YrYDPOQwetsyegeDUB2oolcjXOCwZw53MAQW288R 5rFNFs5H3o+vDqVD1i1Ox93JTpYqGSmnLT/GtmK266OjjIcT7ftz4VuVGsWD/T+K CQzcoa+CfrY8XQFtnsiUbbhlg5RZYZPN8JJ550pIAXDWIykYP0WFWmtwJuon4xWM 2vRJZI7xQJUQhtZ7CJ2/5YYSTJdOl4pVIqXI9tp/JYdsIbGlEI/SaNS4VwKgpRrl sZJHF6QhClMDz9r3F45eEdHquHVxTCGhs+rEehoq2hXsQXrpeKz5vWDS3yZQZgry PM2upG3ViPUyzoG8AQFZmwI2dNkk9nzf191q2VLuzYO2sBh/3llMBiIZGWtDCLL8 NR4PRPX3vSTcigbodqZ7/Seiq3QDtmdQvhxlHQJKv1KI2lnglniZmK/03Uj7HLWQ ev4vUzhVgo+sEdgUMUuANrDKYG33HMlYNLg75aW38vIqMyqHwDZosaniiQUUpWR5 VFhYrgBcnPDEm824WbMZoyZr1zV4cHt8lmEdDdBEzDhNTh2/50LO6bvDHEAFYgA9 poeBzG7pFIOCg+Pd5/96 =R+zm -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 22:09:35 2016 Received: (at 18128) by debbugs.gnu.org; 5 Nov 2016 02:09:36 +0000 Received: from localhost ([127.0.0.1]:45272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2qQJ-0002Dy-Nv for submit@debbugs.gnu.org; Fri, 04 Nov 2016 22:09:35 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:35764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2qQI-0002Dl-9i for 18128@debbugs.gnu.org; Fri, 04 Nov 2016 22:09:34 -0400 Received: by mail-it0-f44.google.com with SMTP id e187so14003758itc.0 for <18128@debbugs.gnu.org>; Fri, 04 Nov 2016 19:09:34 -0700 (PDT) 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=pdWl4hGcmDufv57v2FzszR43yNtxWfBFBVuIDw66l3g=; b=utUiM3/5o2YdB8PeonReWSidrx5xk3p3hHuG1rT2veR267xQCcAwGWzaGfu5DZNtaE ElCoJAxjlydFQcym1St9gUI+/g6zyfFaqujnZClxqQowFgYi+580e08Jps4sGENv9B+U LgyblRvHGkc2rrcCUE8o+34ZM87e6HFMh+tsJEX4J0j08FMxvejWcqJBgPV/MQuByg+M FqgueudJ/gtmO9Fy/5ZqZBDiBLRpSzwPOa4en2w1v0mP+pEUzHlDiaf2ueBZIGmnaXr8 BEpUOBXxwbfvxJnQKTE5gLz1JOP4yLcmxN7Tk0r0YLII148eo74nWYPcE3LAXAvvHztH 1ZuQ== 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=pdWl4hGcmDufv57v2FzszR43yNtxWfBFBVuIDw66l3g=; b=iH6lWKV6ygfMnzKed4V5I96LLijg54a89ZjAGMFII+ZoM+l8/JB2CRzyRJpNRgFLDu Ll4VMmnpdSWf5rFRcwTB+8Yj4/ckhy2SA24OGmPL2aPSNfDTl+xE2gYwT8tTj9TSlXIv Qb7qHH9RuXY/A8fg6sZmhZbPMHHd8ncV1zhbVGU2VKYItwllGK55ZxODv1l1pZd468mu 6gb2tR2SnDAnZN2ZXsFf+zafUu5v4X7ctBA/6CA9gtaa9wNRlyI1pmE6aKr5m96ntziz VpWN41JLtxnzCuXekwAjPSekYDoyHbHE86XVV3xVpqzbXT7AWYYGUFeuVJo+nUeHcKb9 L7Cg== X-Gm-Message-State: ABUngvfB4UC/y/p72PlqPjOGWHmmH0oZhB+83KgjOATcbFjhGY3j0JYe2k9JRjHz8PD8Hw== X-Received: by 10.107.132.76 with SMTP id g73mr15644260iod.227.1478311768801; Fri, 04 Nov 2016 19:09:28 -0700 (PDT) Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id m128sm17338325itm.9.2016.11.04.19.09.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Nov 2016 19:09:28 -0700 (PDT) From: npostavs@users.sourceforge.net To: Paul Pogonyshev Subject: Re: bug#18128: Diff-mode doesn't refine hunks automatically References: Date: Fri, 04 Nov 2016 22:10:13 -0400 In-Reply-To: (Paul Pogonyshev's message of "Mon, 28 Jul 2014 15:59:12 +0200") Message-ID: <8760o2pth6.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18128 Cc: 18128@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Paul Pogonyshev writes: > Diff-mode should just refine hunks automatically when visiting a > buffer. If it is a performance concern, there should be some > customization option for it and/or this could be done lazily. > A patch was recently added to magit that let-binds write-region-inhibit-fsync around the call to diff-refine-hunk, this was reported to make a significant improvement in speed when refining all hunks in a diff. We should do the same for smerge-refine-subst (or is it possible to do this automatically for all temp files?) before extending diff refinement over the whole buffer. https://patch-diff.githubusercontent.com/raw/magit/magit/pull/2834.patch From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 11 20:28:56 2018 Received: (at control) by debbugs.gnu.org; 12 Jul 2018 00:28:56 +0000 Received: from localhost ([127.0.0.1]:56085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdPTc-0002J5-Cj for submit@debbugs.gnu.org; Wed, 11 Jul 2018 20:28:56 -0400 Received: from mail-it0-f48.google.com ([209.85.214.48]:55633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdPTb-0002Iq-AL; Wed, 11 Jul 2018 20:28:55 -0400 Received: by mail-it0-f48.google.com with SMTP id 16-v6so4882089itl.5; Wed, 11 Jul 2018 17:28:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=E7/kTgHKTXCfupfijdBofeXLt2Si55/QfWQafReTof4=; b=NHaZ/D/e1/1rmEnP2Vl+S2YCYS1J9RAosq415olUX5NLc3aGMd1rY9goXZfPgHwWnT 3AkywWtNmAtMTVKrQdUtM9OGVRk1xTSdu1DNk6U5WcTOCU4R19rKFsw5B9jXX4JKLm5r 826Ykn1nDrLNlX5Ofr9qNt1AUrGYJn4z2+khxFfQnGYEvabZLiFuu5DIKw5YSK6R+Sjv fsCc1XELygPJXzkp8QPDdPpOeNlMZUI3zmdBRm4LANA1bSBqWTJNyED+NrhQhWCN6qzA 6CP591+RhDvGlXulJQq/mL1cA84tdOUJE6slSF2ZDmNX+TtDDlrFmedule9/N6ANkWDG UKCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=E7/kTgHKTXCfupfijdBofeXLt2Si55/QfWQafReTof4=; b=KYUFz3UUiCaTqdQGsnj4s/2GvG3kcffD2yz0uQDjBWYfkMQ0GMGtoreW8pg+3jYhHR ITvJux2O6OnPiVws1u+J8IVq9OT6zr7CziSOHGVmvirh1W0BQOLE/TDCkezK9mIdIPgX YZYgnIhlcRWOaJdnxOJ+1dstNuilzB2AOaTH1dtqPsnDUmMiRdY1yMewZDGjlUqWnv1T 2HsDGDSLPaTABN/tTci8QWJLRVd7HbOQiyOi3FXSGqVz0314SiL1QVZIo0RmXCN20Ewi ndVHWbP6AtdkPg67hGKxGPNAZEtWW843+u9MMOLCmjR662Nr1hilF+zmo29led5XhsIJ OeVQ== X-Gm-Message-State: AOUpUlGSoZAn4OL0LyhMUE4bVY/9Bt/M5D+cSCEZ+zzVsOjirTifpY9A DYoqqfOslonJkoYq7EacZ9brBA== X-Google-Smtp-Source: AAOMgpd7o2eJXFdZr7zNeULw5y8EgrryKDdgv8BBzmJFM20LY8VFtDEOdl4Fx/hu6R6sannCmHKKeQ== X-Received: by 2002:a02:45cd:: with SMTP id o74-v6mr23206jad.43.1531355329728; Wed, 11 Jul 2018 17:28:49 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id m7-v6sm6350409iog.30.2018.07.11.17.28.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 17:28:48 -0700 (PDT) From: Noam Postavsky To: Stefan Monnier Subject: Re: bug#12747: 23.4; diff-auto-refine-mode process only last hunk in diff (must ALL). References: <87y5iqbxqn.fsf@gavenkoa.example.com> Date: Wed, 11 Jul 2018 20:28:47 -0400 In-Reply-To: (Stefan Monnier's message of "Sun, 28 Oct 2012 09:54:22 -0400") Message-ID: <87601lb8lc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control Cc: 12747@debbugs.gnu.org, Oleksandr Gavenko X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain merge 12747 16798 18128 21744 tags 12747 fixed close 12747 27.1 quit Stefan Monnier writes: > 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). I think you've implemented this now [1: f8b1e40fb6], though not quite in the way you describe (I don't see any timers). [1: f8b1e40fb6]: 2018-07-10 22:52:21 -0400 * lisp/vc/diff-mode.el: Perform hunk refinement from font-lock https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=f8b1e40fb63b0a6bc6692cc0bc84e5f5e65c2644 This reminds that magit users found binding write-region-inhibit-fsync around smerge-refine-regions made a noticable performance difference. So should we add something like this? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Speed-up-smerge-refine-regions-by-avoiding-fsync.patch Content-Description: patch >From e5f3cf973c37ddaca92cc819d95d896ca0d869c7 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 11 Jul 2018 20:13:25 -0400 Subject: [PATCH] Speed up smerge-refine-regions by avoiding fsync * lisp/vc/smerge-mode.el (smerge-refine-regions): Bind write-region-inhibit-fsync to t. --- lisp/vc/smerge-mode.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index cb51fbab8e..cb9880c80d 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -1075,9 +1075,10 @@ smerge-refine-regions (if smerge-refine-weight-hack (make-hash-table :test #'equal)))) (unless (markerp beg1) (setq beg1 (copy-marker beg1))) (unless (markerp beg2) (setq beg2 (copy-marker beg2))) - ;; Chop up regions into smaller elements and save into files. - (smerge--refine-chopup-region beg1 end1 file1 preproc) - (smerge--refine-chopup-region beg2 end2 file2 preproc) + (let ((write-region-inhibit-fsync t)) ; Don't fsync temp files. + ;; Chop up regions into smaller elements and save into files. + (smerge--refine-chopup-region beg1 end1 file1 preproc) + (smerge--refine-chopup-region beg2 end2 file2 preproc)) ;; Call diff on those files. (unwind-protect -- 2.11.0 --=-=-=-- From unknown Thu Aug 14 17:30:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 10 Aug 2018 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator