From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#459: Zero-length overlays, overlay keymaps, and `overlays-at' Date: Mon, 19 Jul 2021 19:29:05 +0300 Message-ID: <83y2a25ktq.fsf@gnu.org> References: <485D204B.2@dr-qubit.org> <875yx6mijw.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16178"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 459@debbugs.gnu.org, t.s.cubitt.98@cantab.net To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 19 18:30:28 2021 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 1m5W9z-00046y-Lw for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Jul 2021 18:30:27 +0200 Original-Received: from localhost ([::1]:54798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5W9y-0004Ja-JR for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Jul 2021 12:30:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5W9b-0004IQ-FL for bug-gnu-emacs@gnu.org; Mon, 19 Jul 2021 12:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5W9b-0007D3-62 for bug-gnu-emacs@gnu.org; Mon, 19 Jul 2021 12:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5W9b-00050c-0R for bug-gnu-emacs@gnu.org; Mon, 19 Jul 2021 12:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Jul 2021 16:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 459 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 459-submit@debbugs.gnu.org id=B459.162671216019178 (code B ref 459); Mon, 19 Jul 2021 16:30:02 +0000 Original-Received: (at 459) by debbugs.gnu.org; 19 Jul 2021 16:29:20 +0000 Original-Received: from localhost ([127.0.0.1]:60128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5W8u-0004zG-EE for submit@debbugs.gnu.org; Mon, 19 Jul 2021 12:29:20 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5W8s-0004z4-Km for 459@debbugs.gnu.org; Mon, 19 Jul 2021 12:29:18 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48924) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5W8m-0006eG-Ng; Mon, 19 Jul 2021 12:29:12 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4576 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5W8m-0002MY-6J; Mon, 19 Jul 2021 12:29:12 -0400 In-Reply-To: <875yx6mijw.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 19 Jul 2021 17:26:11 +0200) 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:210290 Archived-At: > From: Lars Ingebrigtsen > Date: Mon, 19 Jul 2021 17:26:11 +0200 > Cc: 459@debbugs.gnu.org > > > Suggestions for possible fixes: > > ------------------------------- > > a) Modify (overlays-at pos) to return zero-length overlays that start > > at pos (it already returns all other overlays that start at > > pos). Again, this seems unlikely to have significant impact on other > > parts of Emacs, since zero-length overlays are rarely used. > > > > b) Modify (overlays-at pos) to return zero-length overlays that start > > at pos, and have a null front-advance and non-nil rear-advance > > property. (The logic for this is the same as in option b) for the > > overlay keymaps issue.) > > > > c) Leave `overlays-at' unchanged, and define a new function > > `overlays-at-point' that implements either a) or b). > > Hm... the issue here is that if a zero-length overlay has a > read-advance property, then it can influence what happens when you type > something at that position. So b) makes sense to me on that level. > > But I'd worry that it'd break code that's not aware of zero-length > overlays. And introducing a new function doesn't seem very attractive. We could add a new optional argument to overlays-at, to make it return such overlays. That would avoid the risk of breaking unsuspecting callers.