From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#459: Zero-length overlays, overlay keymaps, and `overlays-at' Date: Mon, 19 Jul 2021 14:19:25 -0400 Message-ID: References: <485D204B.2@dr-qubit.org> <875yx6mijw.fsf@gnus.org> <83y2a25ktq.fsf@gnu.org> <87y2a2i7kc.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28873"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , 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 20:20:17 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 1m5XsG-0007LK-Mv for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Jul 2021 20:20:16 +0200 Original-Received: from localhost ([::1]:56610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5XsF-0003OP-OV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Jul 2021 14:20:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Xs2-0003NJ-FN for bug-gnu-emacs@gnu.org; Mon, 19 Jul 2021 14:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5Xs2-0005WZ-7V for bug-gnu-emacs@gnu.org; Mon, 19 Jul 2021 14:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5Xs2-0003fu-3t for bug-gnu-emacs@gnu.org; Mon, 19 Jul 2021 14:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Jul 2021 18:20: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.162671877714091 (code B ref 459); Mon, 19 Jul 2021 18:20:02 +0000 Original-Received: (at 459) by debbugs.gnu.org; 19 Jul 2021 18:19:37 +0000 Original-Received: from localhost ([127.0.0.1]:60297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Xrd-0003fC-3p for submit@debbugs.gnu.org; Mon, 19 Jul 2021 14:19:37 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5XrZ-0003ex-U8 for 459@debbugs.gnu.org; Mon, 19 Jul 2021 14:19:35 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E5B7180928; Mon, 19 Jul 2021 14:19:27 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6E8458043C; Mon, 19 Jul 2021 14:19:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1626718766; bh=fZp2pWOsFa7dW/7gUVICSxSrDc0itp88yJW2Vi1Bl4c=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=JyZbLJQ4sEMuzIRnBDCMuK3P7HRm58CHHGkrH3VjAqBHYbHIYSYHy2aPhXO4w5Dwd fSZbtUGQu+PQp5hEad0nZT0oCvmVLoSBCZxkxWOM29YzmMtRf1wd/etywYeUAwBwUh oUfKy3TJ6X7PwM4LRe0DBC3xw10RuElEbIYdI8HDndtQI+UrNUCPTmRoPzOPFkWkEj 6lJvxGkyfqLdLTT3UdOzvi/tnb1X+2In2ZtfbvUsW+uipNcTqkW2wDHPrxiElxFWIg xWFRgdpkQYPkiB2fQ/giN3231LhQNqtoe6AFI2Mq4U0GI8aMmdCTsIjp+qENhQk/E1 hbEO9pX2kWSiA== Original-Received: from alfajor (unknown [216.154.29.138]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 324231204DB; Mon, 19 Jul 2021 14:19:26 -0400 (EDT) In-Reply-To: <87y2a2i7kc.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 19 Jul 2021 18:37:07 +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:210301 Archived-At: Lars Ingebrigtsen [2021-07-19 18:37:07] wrote: > Eli Zaretskii writes: >>> > 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). > > [...] > >> 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. > > Yeah, that's true. Do you have any opinion on whether a) or b) would > make the most sense if given this optional argument? I'm leaning > towards b)... I vote for a) with or without the requirement of a new optional arg. The reason I vote for a) rather than b) is because AFAICT `overlays-at` does not pay currently attention to from/rear advance properties, so it would be weird to do that just for empty overlays. Stefan