From unknown Fri Aug 15 02:03:40 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#21744 <21744@debbugs.gnu.org> To: bug#21744 <21744@debbugs.gnu.org> Subject: Status: 24.5; diff-mode highlight only suitable part Reply-To: bug#21744 <21744@debbugs.gnu.org> Date: Fri, 15 Aug 2025 09:03:40 +0000 retitle 21744 24.5; diff-mode highlight only suitable part reassign 21744 emacs submitter 21744 Evgeniy Dushistov severity 21744 wishlist tag 21744 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 10:56:21 2015 Received: (at submit) by debbugs.gnu.org; 23 Oct 2015 14:56:21 +0000 Received: from localhost ([127.0.0.1]:34921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpdlU-0003oX-Co for submit@debbugs.gnu.org; Fri, 23 Oct 2015 10:56:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:32774) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpdlA-0003nc-BM for submit@debbugs.gnu.org; Fri, 23 Oct 2015 10:56:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zpdl8-0004yZ-Mr for submit@debbugs.gnu.org; Fri, 23 Oct 2015 10:55:59 -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.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpdl8-0004yT-KN for submit@debbugs.gnu.org; Fri, 23 Oct 2015 10:55:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpdl7-0007TB-K9 for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2015 10:55:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zpdl2-0004tz-Co for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2015 10:55:57 -0400 Received: from smtp44.i.mail.ru ([94.100.177.104]:52500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zpdl1-0004sV-UO for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2015 10:55:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=EwRN7PsHdz17oGXyCWt7Fn1JquXxIBwCX/SnavPsqQM=; b=SiKwV43omqOb4+54YcSeSclAIlq7yWa7+YX2G02lvYAbvgFIl7kYEpvO21Ulnenvv3EeuHB0l9ISi05vp6PqGeagSs9ufx6dqx6Y77mz0s8EPdTdX49a91XUBnpZp3Hyj30DW9EvpRpr+Q5Q3etI0M2QVmMBdyeKXP4EnUeYBy8=; Received: from [89.23.194.117] (port=54376 helo=whiterain) by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1Zpdkz-0008Pw-AV for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2015 17:55:49 +0300 Date: Fri, 23 Oct 2015 17:55:47 +0300 From: Evgeniy Dushistov To: bug-gnu-emacs@gnu.org Subject: 24.5; diff-mode highlight only suitable part Message-ID: <20151023145547.GA4307@whiterain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Mras: Ok X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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 (----) For example let's I have such content of *vc-diff* diff --git a/cmake/FindLibClang.cmake b/cmake/FindLibClang.cmake index 8aa7689..62b5b08 100644 --- a/cmake/FindLibClang.cmake +++ b/cmake/FindLibClang.cmake @@ -72,7 +72,7 @@ if (NOT LIBCLANG_CXXFLAGS) endif () set(LIBCLANG_CXXFLAGS "-I${LIBCLANG_CXXFLAGS}") endif () - string(REGEX REPLACE "-([Og][0-9]*|std=c\\+\\+..|(W|f)[a-zA-Z-]*|DNDEBUG) ?" "" LIBCLANG_CXXFLAGS "${LIBCLANG_CXXFLAGS}") + string(REGEX REPLACE "-([Og][0-9]*|std=c\\+\\+..|(W|f)[=a-zA-Z-]*|DNDEBUG) ?" "" LIBCLANG_CXXFLAGS "${LIBCLANG_CXXFLAGS}") set(LIBCLANG_CXXFLAGS ${LIBCLANG_CXXFLAGS} CACHE STRING "The LLVM C++ compiler flags needed to compile LLVM based applications.") unset(LIBCLANG_CXXFLAGS_HACK_CMAKECACHE_DOT_TEXT_BULLSHIT CACHE) endif () the diff-mode highlight string with starting "-" with red, and starting "+" with green, it would be great if it highlight also difference between strings. There is only "=" symbol difference between two lines above, so it would be great if emacs highlight also "=" in the second string. You can see how github doing this: https://github.com/Dushistov/rtags/commit/5d0419c453dde58bf3a37a00bf0e63bd186154bc -- /Evgeniy From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 23 11:44:37 2015 Received: (at 21744) by debbugs.gnu.org; 23 Oct 2015 15:44:37 +0000 Received: from localhost ([127.0.0.1]:34929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpeWD-0004xh-BP for submit@debbugs.gnu.org; Fri, 23 Oct 2015 11:44:37 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:37386) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpeVu-0004xF-1W for 21744@debbugs.gnu.org; Fri, 23 Oct 2015 11:44:36 -0400 Received: by wicfv8 with SMTP id fv8so37700838wic.0 for <21744@debbugs.gnu.org>; Fri, 23 Oct 2015 08:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=zHFaTMEIvaVsV4Tv9Je6V1UkY4VrN/gNbQV4vxWtus8=; b=np8o0buXOXsQDCxZIIkK7ON8X3N4yp/MVn9bxT6L4Iod6juGuCvDI+ADPYXk9k+uar nkgIvPGiZVklOForA2tQMgDrnJNxiEhbBHWH+U6JrPQYKGqVhtin9rA5slnPyGQpWSEq hphbS97bmHjgWRUMPxika+mzxSXWeobv4ruMPnQ30WL+xNafnZYlEn9CSGh5hRXwcOHJ I/YCSfM5oCek7gQLKpBLFWeW5Aab7oB1Da2jZpz09VnL4fLjfp2MXGHpxHolR5VQ0QoX q5scG31wbXiuuyVF3nmHviJWVuhaA7B2HdBRD3EhmTTB6bcGbhK2qh3zHTTClM/IUo1c XXyQ== X-Received: by 10.194.48.113 with SMTP id k17mr5401382wjn.62.1445615056977; Fri, 23 Oct 2015 08:44:16 -0700 (PDT) Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id w9sm1796913wjf.20.2015.10.23.08.44.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2015 08:44:15 -0700 (PDT) Subject: Re: bug#21744: 24.5; diff-mode highlight only suitable part To: Evgeniy Dushistov , 21744@debbugs.gnu.org References: <20151023145547.GA4307@whiterain> From: Dmitry Gutov Message-ID: <562A55CE.80201@yandex.ru> Date: Fri, 23 Oct 2015 18:44:14 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <20151023145547.GA4307@whiterain> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21744 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 (/) Hi Evgeniy, On 10/23/2015 05:55 PM, Evgeniy Dushistov wrote: > the diff-mode highlight string with starting "-" with red, and starting "+" with green, > it would be great if it highlight also difference between strings. > There is only "=" symbol difference between two lines above, so it would be great > if emacs highlight also "=" in the second string. We currently have this feature in the shape of diff-auto-refine-mode. Try pressing `n' or `p': the navigation commands also refine the hunks to show the differences. There has been some talk of doing that automatically (using font-lock), but the refining algorithm is rather slow on large hunks. I'd also recommend installing diff-hl (available in ELPA): it remaps the vc-diff command to its own wrapper that also scrolls to the hunk corresponding to the current line, and refines it. 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 Fri Aug 15 02:03:40 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