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 11:03:16 +0300 Message-ID: <831qkscgfv.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> <66d58398-8eb5-4d89-8e7c-4400f180448f@app.fastmail.com> <83lej0l3w5.fsf@gnu.org> <353c12ab-fddd-c7da-c8bc-065a2c8a26e9@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22621"; 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 10:03:12 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 1plmUZ-0005du-M4 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 Apr 2023 10:03:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plmU4-0007BH-Ut; Mon, 10 Apr 2023 04:02:40 -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 1plmU3-0007B5-Cj for help-gnu-emacs@gnu.org; Mon, 10 Apr 2023 04:02:39 -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 1plmU3-00077w-4k for help-gnu-emacs@gnu.org; Mon, 10 Apr 2023 04:02:39 -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=UMJe3mSzGjkN/RdIx5RV7LkiSDfdc0cYwyavhlaEsOw=; b=Xu8EC9TlsFUK FTzEz9zDqbB0LvSSe/3YeOMWozwcb2SVeBuaDrcr5Pa2FxkPt3s+TYXT3vqLIZzf4Wc+cCeIjDsQp toRnXBWAP8y8U5/bduKJVRbIKg87BLIokHMS8JaADM3yt+nXyW4EI1vm1npzUa7bDU59zHb8GmCtV PLZd9qwQXVgwNRV0oERUFGaVcm0faJ5ldRLlI/e/e/FaNWMalyxqwDpj9qjNCwFPkw2/himbTmqpV 09o6sYFzKRR8A6TRILk/e7qE0++wPMpWDVeDvUPJT2a1QPaf565wFH2u5R/YaSS9RaySAu98MEAlt Ti1CB3J16aE/6UMVMKURng==; 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 1plmU1-0000SI-NX for help-gnu-emacs@gnu.org; Mon, 10 Apr 2023 04:02:38 -0400 In-Reply-To: <353c12ab-fddd-c7da-c8bc-065a2c8a26e9@gmail.com> (message from Platon Pronko on Mon, 10 Apr 2023 13:37:37 +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:143248 Archived-At: > Date: Mon, 10 Apr 2023 13:37:37 +0800 > From: Platon Pronko > > On 2023-04-10 13:09, Eli Zaretskii wrote: > > How is this different from the front-advance and rear-advance > > arguments you can specify when creating the overlay. > > front-advance and rear-advance control if the typed text should be included in overlay. In case of inline type hints, typed text never needs to be included. Is that the only effect of front-advance and rear-advance in this case? > > Did you look at how set-minibuffer-message succeeds in setting the > > cursor? did you try using the same technique? > > > > Did you try both before-string and after-string overlays? > > > > Did you try non-"empty" overlays, i.e. those whose start and end are > > not the same buffer position? They can have before-string and > > after-string properties as well. > > I did. All these examples are about consitently positioning cursor before or after overlay at all times, and they of course work. But none of them allow cursor position to move from beginning to the end of overlay without nasty hacks with detecting cursor position and manually changing overlay properties. I'm not sure which part(s) are considered "nasty hacks" in your eyes, given that you are already okay with using "empty" overlays for displaying the hints. In any case, an overlay can have a 'keymap' property, where you could perhaps redefine what C-f, C-b, and perhaps some other relevant movement commands do. Did you try that?