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 10:19:30 +0200	[thread overview]
Message-ID: <83wnknpgfh.fsf@gnu.org> (raw)
In-Reply-To: <87tufry0jp.fsf@yahoo.com> (message from Po Lu on Thu, 02 Dec 2021 14:37:46 +0800)

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 02 Dec 2021 14:37:46 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Btw, why did you want to assume that? what did you want to do if
> > window_end_valid were true?
> 
> I wanted to set w->cursor_valid_p (a field I added to `struct window')
> to false there, if PT > w->window_end_pos.

So you want to know whether point is beyond the window's end?  That's
possible; we do that in several places in the existing code.  It's
just slightly more complicated than a simple comparison with a known
value, and requires to use the move_it_* functions.  Basically, you
tell move_it_to to move to PT or to last_visible_y, whichever happens
first, and then examine the results: if it reached PT, then point is
inside the window, otherwise it isn't.

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.



  reply	other threads:[~2021-12-02  8:19 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 [this message]
2021-12-02  9:51                   ` Po Lu
2021-12-02 10:17                     ` Eli Zaretskii

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=83wnknpgfh.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.