From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zack Weinberg Newsgroups: gmane.emacs.bugs Subject: bug#45054: 27.1; Can get point into the middle of a run of characters with a replacing display spec Date: Sat, 5 Dec 2020 15:00:30 -0500 Message-ID: References: <83sg8kb514.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4217"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45054@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 05 21:01:24 2020 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 1kldkB-00010U-P9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 21:01:23 +0100 Original-Received: from localhost ([::1]:52596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kldkA-0006l5-Rf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 15:01:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kldjr-0006ky-F0 for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2020 15:01:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36747) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kldjq-0000L7-8O for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2020 15:01:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kldjq-000333-7P for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2020 15:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Zack Weinberg Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Dec 2020 20:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45054 X-GNU-PR-Package: emacs Original-Received: via spool by 45054-submit@debbugs.gnu.org id=B45054.160719844411686 (code B ref 45054); Sat, 05 Dec 2020 20:01:02 +0000 Original-Received: (at 45054) by debbugs.gnu.org; 5 Dec 2020 20:00:44 +0000 Original-Received: from localhost ([127.0.0.1]:48293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kldjY-00032Q-Fz for submit@debbugs.gnu.org; Sat, 05 Dec 2020 15:00:44 -0500 Original-Received: from mailbackend.panix.com ([166.84.1.89]:15791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kldjW-00032H-Mr for 45054@debbugs.gnu.org; Sat, 05 Dec 2020 15:00:43 -0500 Original-Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4CpL6L29tjz1QS9 for <45054@debbugs.gnu.org>; Sat, 5 Dec 2020 15:00:42 -0500 (EST) Original-Received: by mail-ed1-f48.google.com with SMTP id u19so9499726edx.2 for <45054@debbugs.gnu.org>; Sat, 05 Dec 2020 12:00:42 -0800 (PST) X-Gm-Message-State: AOAM532niDaPFBfEKS56HjLgcuTrsbVW3Ja0mqVBdNu7ccW8mdQmgShY T1VzOKHFABjxRL29TXy015mjwep5vVjHkV5FOhc= X-Google-Smtp-Source: ABdhPJyQl7XZYUhmfHEczo32St6/66JIbug4GugKELLzm0wq2pXhmpiQNLxwHlc3G2RZTd+U0wvMRmSKJpFAwv4iGDY= X-Received: by 2002:a50:9f4a:: with SMTP id b68mr13234255edf.296.1607198441466; Sat, 05 Dec 2020 12:00:41 -0800 (PST) In-Reply-To: <83sg8kb514.fsf@gnu.org> X-Gmail-Original-Message-ID: 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:195052 Archived-At: On Sat, Dec 5, 2020 at 11:18 AM Eli Zaretskii wrote: > > 1. Is this indeed a bug in Emacs? > > Probably a bug in adjust_point_for_property. Try your recipe after > setting global-disable-point-adjustment non-nil. No change, but set-variable doesn't recognize that variable (so I used setq instead) Is this variable possibly only available in development trunk and/or in an Emacs compiled with internal debugging enabled? I'm using 27.1 as packaged by Debian, right now. > > 2. Assuming it is, can you suggest a workaround? I=E2=80=99m hoping fo= r a > > viable solution within my code that=E2=80=99s compatible at least as= far back > > as Emacs 24. > > A workaround in Lisp? Try making the affected text, or some of it, > invisible, i.e. give it the 'invisible' text property as well. (I > didn't try to test this solution, so I cannot promise it will work.) That makes the situation worse: with the mode enabled, I can separate point from the visible cursor just by attempting to move the visible cursor over the displayed =C2=B6. Also, if the =C2=B6 is at the beginning = of a line and point is at the end of that line, C-a moves only to after the (invisible) 6. And redisplay gets screwed up if I delete one of the invisible characters. > > 3. I think it would be better UI if the C-d in the recipe deleted the > > entire run of text that=E2=80=99s getting hidden (more generally, de= letion > > commands should behave as if the =C2=B6 is really what=E2=80=99s in = the buffer). > > I can=E2=80=99t figure out how to implement that, can you suggest an= ything? > > Why can't you delete every character around point that has this > special property? I don't know how to do that. My best guess is this would be done in a change hook, but I'm not sure of that, and I don't understand how to write change hooks, either. Is there a good example or guide-level documentation you could point me at? zw