unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: JD Smith <jdtsmith@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: cursor-intangible and rear-nonsticky t
Date: Mon, 5 Apr 2021 12:58:19 -0400	[thread overview]
Message-ID: <88226B26-38AF-4B02-9E5E-A333AC8E2CC4@gmail.com> (raw)
In-Reply-To: <jwvmtucn0va.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]



> 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)))


[-- Attachment #2: Type: text/html, Size: 13198 bytes --]

  parent reply	other threads:[~2021-04-05 16:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-05 15:26 cursor-intangible and rear-nonsticky t JD Smith
2021-04-05 16:47 ` Stefan Monnier
2021-04-05 16:56   ` Stefan Monnier
2021-04-05 16:58   ` JD Smith [this message]
2021-04-05 17:01     ` Stefan Monnier
2021-04-05 18:02       ` JD Smith
2021-04-05 18:47         ` Stefan Monnier
2021-04-05 21:11           ` JD Smith
2021-04-05 21:30             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88226B26-38AF-4B02-9E5E-A333AC8E2CC4@gmail.com \
    --to=jdtsmith@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).