From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#57150: 29.0.50; [PATCH] Add test coverage for overlay modification hooks Date: Wed, 17 Aug 2022 18:05:00 +0800 Message-ID: <87zgg3yylv.fsf@localhost> References: <87ilmygjyv.fsf@rfc20.org> <878rns946i.fsf@localhost> <87zgg7fyb8.fsf@rfc20.org> <87y1vqxhw2.fsf@localhost> <83mtc5iw80.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40300"; mail-complaints-to="usenet@ciao.gmane.io" Cc: matt@rfc20.org, Eli Zaretskii , 57150@debbugs.gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 17 12:06:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oOFwJ-000AJ3-HF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 12:06:19 +0200 Original-Received: from localhost ([::1]:60666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOFwI-0006yt-Ck for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 06:06:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOFv4-0006wq-9J for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 06:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oOFv4-0006Pq-0p for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 06:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oOFv3-0006k7-Mg for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 06:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Aug 2022 10:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57150 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57150-submit@debbugs.gnu.org id=B57150.166073064725845 (code B ref 57150); Wed, 17 Aug 2022 10:05:01 +0000 Original-Received: (at 57150) by debbugs.gnu.org; 17 Aug 2022 10:04:07 +0000 Original-Received: from localhost ([127.0.0.1]:49458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oOFuB-0006in-1V for submit@debbugs.gnu.org; Wed, 17 Aug 2022 06:04:07 -0400 Original-Received: from mail-ot1-f46.google.com ([209.85.210.46]:44006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oOFu8-0006iI-Bf for 57150@debbugs.gnu.org; Wed, 17 Aug 2022 06:04:06 -0400 Original-Received: by mail-ot1-f46.google.com with SMTP id 53-20020a9d0838000000b006371d896343so9107840oty.10 for <57150@debbugs.gnu.org>; Wed, 17 Aug 2022 03:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc; bh=W8a3offPk9V+/RUPx8vgTVE+aNwlGxB+hUnhqIUmWmA=; b=dOy4RmD+M2mE1ULZfXGY8P7F3V5xW9A3UwR6nfQNRdjX/OR7JwoH7LJjYiZzIysJmO MH+L42dSMe22Umbldksu+U0vVwr9796yJ9QF8rulIyoOJO34AMNblAJxqq+n8r0GbYxR sMlRXYQ+F6Np6n5LNpqEKbyLmTvyVk3Nd4Lgo+1QcPUk7r+KqrJQstSyd3c9jjXmqqAp /IBKe37BCDk406QYa0kExV6K7yOiJmqMy/twKPzKzWUCDn7x+9CvIH3HU1kFIOQIPNF1 WHQT8cL2dDXRvlgpH3skJwhJ51+iBpAhIxvxV0QIbjxKO5X83kzL4MKVybJdv6POtybc QaEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=W8a3offPk9V+/RUPx8vgTVE+aNwlGxB+hUnhqIUmWmA=; b=QJomu3bWvr2+NuQpgOao7waBlUO8cvBXEa/pi9I9TTdcxiHY/RUrDUr7AD1mO+s776 iUOgui3gtP9kecE247scpp1hYXGh0mHtJEmSnG1clSeEurOf8S4QkyP/NoYtN+WhGMbW CDl5M4RJCBKMjsU1ZS7TiCCr7gxwacvzkTsHCcBVmJpRhTeHGMVwypzw7bkqct8kUmT6 ioKRUT3q3MQpT7AhoXb8Ja+ABirZuNH2dn6hl6bz2mL8Vr+LU0p7isVYyrBBeruphhCW g1tcAdeuBHcICOlSfDEkyfe4C85+jPvLhbDX8U47FHvxTHDtVNJyl/a0f1N5hR+qQTf4 AjEA== X-Gm-Message-State: ACgBeo07cYJeVjdRLFwcntFTwk8vx4L2aWdnvMUpz4kR9HH2k9hbpf+3 4sBU45WFkI/5hCSK9hs62Vc= X-Google-Smtp-Source: AA6agR4bZ3yxK/TMNCKTFA7rR5UreYEGKav/IuAzA1Gulon98bE5UrTh8lCn9QwtxV3CinMKqQiddg== X-Received: by 2002:a05:6830:18fa:b0:638:d46c:1374 with SMTP id d26-20020a05683018fa00b00638d46c1374mr2043749otf.142.1660730638619; Wed, 17 Aug 2022 03:03:58 -0700 (PDT) Original-Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id t2-20020a4a8242000000b004357ccfc8bfsm2912379oog.7.2022.08.17.03.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 03:03:57 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:240033 Archived-At: Richard Stallman writes: > The first question is, should these use text properties instead of > overlays? It may be possible, but there are non-trivial implications when one attempts to replace overlays with text properties. Some implications I can remember quickly: (1) Overlays do not overwrite original properties and thus removing overlays automatically recovers the original properties. Not so easily when using text properties. (2) Overlays are not copied when the text is killed. Text properties are. Overlays are also not carried between indirect buffers. (3) Inserting text inside overlays automatically inherits their properties. To do the same with text properties, one must use special functions like `insert-and-inherit', which is not common in packages. To conclude, overlays and text-properties are similar in many aspects, but also handled differently in other aspects. These differences make it very annoying to change from overlays to text property approaches. > Are they using many overlays to highlight many potential matches in a > long buffer? If so, would it make sense to show, at any time, only those > that are near point? When you move to a far-away part of the buffer, > it could add highlighting to the matches near there. But maybe it > can avoid ever trying to highlight more than a few parts of the buffer. I guess it can be a valid optimization in some cases. But it is not always possible. For example, consider folded headlines in Org mode. They have some initial folding state set when opening the file, but the state can be changed any time by the user. It is technically challenging to put overlays on the fly in such scenario. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92