all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: Re: try_cursor_movement not called?
Date: Thu, 02 Dec 2021 12:17:55 +0200	[thread overview]
Message-ID: <83h7brpay4.fsf@gnu.org> (raw)
In-Reply-To: <87h7brxrl7.fsf@yahoo.com> (message from Po Lu on Thu, 02 Dec 2021 17:51:16 +0800)

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 02 Dec 2021 17:51:16 +0800
> 
> > But beware of the underwater rocks: the window could end in some
> > display property, like display string or image, or in a an overlay
> > string.  These cases require special care with the move_it_*
> > functions.
> 
> However, I don't know about this.  Could you perhaps elaborate further?

It's a very long story with a lot of confusing details.  Basically, if
there's any of those at the end of the window, the buffer position you
get when move_it_* functions return is not necessarily the one you
want, because those functions won't consider buffer positions while
they traverse display/overlay strings or images.  For example, if
point is "covered" by a display property, move_it_to will stop after
the display property, not at point.

I'm not sure how much of this is relevant for your use cases, though.
Just be sure to test the code when these properties are at point or at
the end of the window (if point is outside of the window).



      reply	other threads:[~2021-12-02 10:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87czmg1wh8.fsf.ref@yahoo.com>
2021-12-01  9:54 ` try_cursor_movement not called? Po Lu
2021-12-01 10:57   ` Eli Zaretskii
2021-12-01 12:07     ` Po Lu
2021-12-01 12:36       ` Eli Zaretskii
2021-12-01 12:39         ` Po Lu
2021-12-01 12:49           ` Eli Zaretskii
2021-12-02  6:31             ` Eli Zaretskii
2021-12-02  6:37               ` Po Lu
2021-12-02  8:19                 ` Eli Zaretskii
2021-12-02  9:51                   ` Po Lu
2021-12-02 10:17                     ` Eli Zaretskii [this message]

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

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

  git send-email \
    --in-reply-to=83h7brpay4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.