From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: cursor-intangible and rear-nonsticky t Date: Mon, 5 Apr 2021 12:58:19 -0400 Message-ID: <88226B26-38AF-4B02-9E5E-A333AC8E2CC4@gmail.com> References: <11A4C2D3-101E-4121-8DFD-D6451B28C8F1@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_3566FEDF-F0B6-42F5-9B98-37441FBD94B6" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36199"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 05 18:59:33 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lTSZY-0009IN-7E for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Apr 2021 18:59:32 +0200 Original-Received: from localhost ([::1]:47650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTSZX-0006si-90 for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Apr 2021 12:59:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTSYU-0006MD-5s for emacs-devel@gnu.org; Mon, 05 Apr 2021 12:58:26 -0400 Original-Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:38508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTSYR-000325-Ch for emacs-devel@gnu.org; Mon, 05 Apr 2021 12:58:25 -0400 Original-Received: by mail-qk1-x732.google.com with SMTP id c3so12137400qkc.5 for ; Mon, 05 Apr 2021 09:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=R1vsv3jad47idiT1hOkhebc6SSUPLoRWv6+WM8zLuDs=; b=MQHbxtViU/UJc7uzSum+zmiVgKTHEaci+XQ44J+2cErKWVDFwkBKZVR1A4pjnnsoeI +yZOExgPjlbvPeyNYKXt6E0Fxjfvk/QIEdJz6TPN8NmYVSALctPLlBmOpmGL6i3hl7mg gmI+/W1dyAJZEHMGufzt1jBLxoWpgOzAC0PxnYr/jcoyGsbnoAV+IqzkKaFvq+hXJNeu 6gTMbDnTMrr5wA5piqyt5AUhj5hywoZItn9ESHL6To1Re/Qmw3ycFIUFnvhEp8GijNda Nhr6EpdFbkwO9cgspY8+R+oblqyOJq2zbheNXKozAluzQbT6/JP6YnYWjQoy1M6K9FqP 9fLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=R1vsv3jad47idiT1hOkhebc6SSUPLoRWv6+WM8zLuDs=; b=Buv/Xz3WPP+rTeTrY57Az8gJSKhgBlz7lC/zPzZDVbZTfgWqLW/N/KAstSMRXeCVaj o0YuZNpIGwTXmU9Kp2wDp7tFq/Bqy6ey7ShEUse/u0Xui4vkEsTj8CdhMnw8rDg3Q+wi gWRBQj5zjDWv1ubO9JCZ9sTeUFFXRB5sSfyS0XU5s5x2N2aEWvOn8y26KcET7F5Pju9u dBImxhYgi8FsqfxpQxcfH72uhZRr2Oqi1GK/CkBP53NRQbPA0Ox8EJ9zmTXAfFb8f3vn hMYeuac8CwEW1MrcY9v4Kz6ZpRU9StxuUxEhVuU3o/H8q2nnZ6HedWNPQBxHrCnSM3iX atMg== X-Gm-Message-State: AOAM533/0/oV0C38t0DtmhW8mC4P3rMNnxtd/elR5gOPRGzlO7Ef5eZi /nNrl7EGIXMaDs5bjt708FE= X-Google-Smtp-Source: ABdhPJy/Qv+ckdtZSoQk8cv4R/oeXUAAVHrz8Z7uJdwdVpTyhTz98jiezpXboY9+47FPD7V2bc3LTg== X-Received: by 2002:a05:620a:14d:: with SMTP id e13mr25839258qkn.187.1617641901705; Mon, 05 Apr 2021 09:58:21 -0700 (PDT) Original-Received: from [192.168.0.116] (cm-134-228-54-223.buckeyecom.net. [134.228.54.223]) by smtp.gmail.com with ESMTPSA id s19sm13586865qks.130.2021.04.05.09.58.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Apr 2021 09:58:21 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.4) Received-SPF: pass client-ip=2607:f8b0:4864:20::732; envelope-from=jdtsmith@gmail.com; helo=mail-qk1-x732.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267423 Archived-At: --Apple-Mail=_3566FEDF-F0B6-42F5-9B98-37441FBD94B6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Apr 5, 2021, at 12:47 PM, Stefan Monnier = wrote: >=20 >> If '(rear-nonsticky t) is among the text properties, the >> `pre-redisplay-functions' do not apparently get called, and so >> 'cursor-intangible fails to function. =20 >=20 > I don't think that's really what happens. I suspect the issue comes > from the difference between `get-pos-property` and = `get-char-property`: > positions (like `point`) are not placed on a character but between two > characters. But text properties only apply to characters. So the > properties that are "on a position" are based on what properties would > a character inherit if it where inserted at that position. >=20 > By default text properties are front-nonstick and rear-sticky, so > basically a position gets its properties from the char right before = it. > But if you set (rear-nonsticky t), then you get no properties at all = at > that position. >=20 > So, I suspect that you're applying (rear-nonsticky t) a bit too > generously, e.g. to all the chars in the prompt rather than only to = the > last one. Interesting, so `rear-nonsticky t` is rather powerful in suppressing = text-properties within contiguous text. =20 I believe `comint-output-filter` is the one responsible for setting = `rear-nonsticky t` across the entire prompt: (let ((prompt-start (save-excursion (forward-line 0) = (point))) (inhibit-read-only t)) ... (add-text-properties prompt-start (point) '(rear-nonsticky = t))) --Apple-Mail=_3566FEDF-F0B6-42F5-9B98-37441FBD94B6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Apr 5, 2021, at 12:47 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

If = '(rear-nonsticky t) is among the text properties, the
`pre-redisplay-functions' do not apparently get called, and = so
'cursor-intangible fails to function.  

I don't think that's really what happens.  I suspect the = issue comes
from the = difference between `get-pos-property` and `get-char-property`:
positions (like `point`) are not = placed on a character but between two
characters.  But text properties only apply to = characters.  So the
properties that are "on a position" are based on what = properties would
a character inherit if it where inserted at that = position.

By default = text properties are front-nonstick and rear-sticky, so
basically a position gets its = properties from the char right before it.
But if you set (rear-nonsticky t), then you get no properties = at all at
that = position.

So, I suspect = that you're applying (rear-nonsticky t) a bit too
generously, e.g. to all the = chars in the prompt rather than only to the
last one.

Interesting, so `rear-nonsticky t` is rather powerful in = suppressing text-properties within contiguous text.  

I believe = `comint-output-filter` is the one responsible for setting = `rear-nonsticky t` across the entire prompt:

  =  (let ((prompt-start (save-excursion (forward-line 0) = (point)))
 (inhibit-read-only = t))
            =  ...
  =    (add-text-properties prompt-start (point) '(rear-nonsticky = t)))

= --Apple-Mail=_3566FEDF-F0B6-42F5-9B98-37441FBD94B6--