From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#459: Zero-length overlays, overlay keymaps, and `overlays-at' Date: Mon, 19 Jul 2021 17:26:11 +0200 Message-ID: <875yx6mijw.fsf@gnus.org> References: <485D204B.2@dr-qubit.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="37180"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 459@debbugs.gnu.org To: Toby Cubitt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 19 17:27:11 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 1m5VAk-0009Vu-RJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Jul 2021 17:27:10 +0200 Original-Received: from localhost ([::1]:44686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5VAj-0005Op-Ra for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Jul 2021 11:27:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5VAc-0005O1-Ll for bug-gnu-emacs@gnu.org; Mon, 19 Jul 2021 11:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5VAc-0006sk-Df for bug-gnu-emacs@gnu.org; Mon, 19 Jul 2021 11:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5VAc-0002pg-9Z for bug-gnu-emacs@gnu.org; Mon, 19 Jul 2021 11:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Jul 2021 15:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 459 X-GNU-PR-Package: emacs Original-Received: via spool by 459-submit@debbugs.gnu.org id=B459.162670838310821 (code B ref 459); Mon, 19 Jul 2021 15:27:02 +0000 Original-Received: (at 459) by debbugs.gnu.org; 19 Jul 2021 15:26:23 +0000 Original-Received: from localhost ([127.0.0.1]:59857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5V9y-0002oT-Ve for submit@debbugs.gnu.org; Mon, 19 Jul 2021 11:26:23 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:46296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5V9w-0002o2-S3 for 459@debbugs.gnu.org; Mon, 19 Jul 2021 11:26:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9wsjAd8exCj9zihmhg60fZfMjmeQS7jPK8aPZPu1qX0=; b=FUBjrVLDbPOauqTd9NsnawjTtr fYNbFBPEwUAv2LPX76ZvPLT+kFcxx0eVdU5ZygXltTQlDEENMHzdf3mQSc1SMfpFOu8Vck9ra7dek wD6VQBsAA9PBzrHEk6iY4OJ75ZIWDx0mpNxnXeErqILjH8rV0b8sILTvNZeZZs3l3LEA=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5V9o-0008DZ-DW; Mon, 19 Jul 2021 17:26:14 +0200 X-Now-Playing: Colored Music's _Individual Beauty_: "Angel" In-Reply-To: <485D204B.2@dr-qubit.org> (Toby Cubitt's message of "Sat, 21 Jun 2008 16:37:47 +0100") 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:210260 Archived-At: Toby Cubitt writes: > "Bug" description: > ------------------ > `overlays-at' never returns zero-length overlays. > > Steps to reproduce: > ------------------- > (make-overlay 1 1) ; any position will do > (overlays-at 1) > > Returns nil instead of the overlay from 1 to 1. (I'm going through old bug reports that unfortunately wasn't resolved at the time.) This is still the case in Emacs 28. > Impact: > ------- > Again, zero-length overlays are probably rarely used. But this makes > it impossible in Emacs to find a zero-length overlay using > `overlays-at'. Instead, one has to work-around this using three calls > to `overlays-in' then filter out overlays that shouldn't be in the > list. Or just `overlay-lists'. > Overlays do fairly frequently become zero-length when the text they > cover is deleted (depending on their front- and rear-advance > properties), and this "bug" makes them suddenly disappear from the > return value of `overlays-at' even though they still exist in the > buffer. > > 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. Does anybody have any opinions here? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no