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.help Subject: Re: Moving point around empty overlays with 'after-text Date: Mon, 10 Apr 2023 08:01:12 +0300 Message-ID: <83mt3gl49z.fsf@gnu.org> References: <9b1654ec-1ac6-4936-860b-2d77dcc4dac7@app.fastmail.com> <28954f0d-205d-b322-4a43-cf4481d1266e@gmail.com> <3a1bb709-d00f-49b8-a2c5-d0ac5b6a82c4@app.fastmail.com> <22b315db-39eb-80b6-1a7c-127f5e703dc1@gmail.com> <2314d321-040a-4466-afdb-4317df7e6584@app.fastmail.com> <01206f38-741a-b75b-4efe-ecf7c70c6d61@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11769"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 10 07:00:55 2023 Return-path: Envelope-to: geh-help-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 1pljeA-0002wR-SM for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 Apr 2023 07:00:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pljdq-0000p7-Qo; Mon, 10 Apr 2023 01:00:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pljdp-0000oQ-CI for help-gnu-emacs@gnu.org; Mon, 10 Apr 2023 01:00:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pljdp-00058P-4P for help-gnu-emacs@gnu.org; Mon, 10 Apr 2023 01:00:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Zazk+03yRO4z3/+3OmIjlCcYF40Zzu2HDX3rD2m43FM=; b=kheS7lcuA3Te hpC2EPbxjgKFkfEnvi1veiCaR4HBxGpqV6i2qGch0uYRV9Jm0i1WlqMOwAmhLQHk1FcoIdR42AVXp 4EIHr+ZvDrsUHko87tzAt1D+f7a1/hZNg+l/Jjzw7VXJIQ5JQu6nFvHZOIKJRZj29q36SV7WqFkAg gSN06R0y337ONoCe3bZiQjl/dFk8YoRkfOgyw3sDt56a92uDN4mIaRIaRHTSTA9gIddqirYJhOaH9 l5W6afZPZu2s1N8bWQmupOyXeSkl2TnjfV+7yAeMaGRMWGK3gcDyLBR5KeFVn6OEyd7nMnZS8YZ9Y 7cYbxl7bmlUg9L0/wCOCJQ==; Original-Received: from [87.69.77.57] (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 1pljdo-0003IF-J9 for help-gnu-emacs@gnu.org; Mon, 10 Apr 2023 01:00:32 -0400 In-Reply-To: <01206f38-741a-b75b-4efe-ecf7c70c6d61@gmail.com> (message from Platon Pronko on Mon, 10 Apr 2023 10:00:52 +0800) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143241 Archived-At: > Date: Mon, 10 Apr 2023 10:00:52 +0800 > From: Platon Pronko > > I think it's even worse than adding a property to the overlay. You need common point manipulation functions to account for possibility of inlays, i.e. (point) for position before and after inlay will be returning different values, (forward-char) will correctly advance the point from the left side to the right side of the inlay, etc. Please keep in mind that point is a _buffer_ position. So asking for point to return different values when the buffer position didn't change is like, to borrow from Albert Einstein, "doing the same thing over and over and expecting different results". > (on second thought, making (point) return different values for positions around overlays sounds horrifying, because this will break about half of all Elisp code written) Exactly. > But inlay hints seem to be a common functionality for any modern IDE nowdays, so it might make sense to support them natively, without making major-mode developers resort to horrible hacks like described before. Well, maybe "someone" should reconsider whether using overlays for that is a good idea, then? Why not help-echo, for example? And I don't think you've tried all of the overlay-related features yet, see my other message.