all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: dancol@dancol.org, monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: Re: Can we make set_point_both less expensive?
Date: Sat, 21 Mar 2015 12:42:29 +0200	[thread overview]
Message-ID: <83mw36tywa.fsf@gnu.org> (raw)
In-Reply-To: <550D40A9.7060905@gmx.at>

> Date: Sat, 21 Mar 2015 10:58:01 +0100
> From: martin rudalics <rudalics@gmx.at>
> CC: dancol@dancol.org, monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
> 
>  >>   > And cursor is always set where point is, we have no other strategy for
>  >>   > positioning the cursor.
>  >>
>  >> After `scroll-left'?
>  >
>  > Yes, after scroll-left, too.  We simply put the cursor as close to
>  > point as possible.
> 
> But not necessarily _where point is_.

I was talking about the implementation.  It looks for the glyph that
is the closest to point.  It never consciously moves the cursor to any
other place.

>  >> Isn't adjust_point_for_property some sort of redisplay revisited?
>  >
>  > No.  It does nothing that is related to display.
> 
> Can't it trigger a new redisplay?

Yes, it can.  But I'm not sure it is needed.

>  >> They would determine the position of the cursor when an intangible area
>  >> starts or ends within them.
>  >
>  > Sorry, too much "they" in this sentence, I don't really understand
>  > what you are sayin, or how it is relevant to the issue at hand.
> 
> Consider the following scenario:
> 
> (1) Using the scrollbar thumb, the user scrolls window text thus
>      implicitly establishing a new window start position WS.
> 
> (2) Respecting WS, redisplay puts window point at some position WP.
> 
> (3) A function on `pre-redisplay-function' decides that WP would end up
>      within intangible text and moves WP to a position WT.
> 
> (4) Redisplay notices that WT would end up in the scroll margin and
>      scrolls the window invalidating WS.  As a result windw text would
>      not scroll as intended by the user in (1).

If the flag that forced redisplay to honor WS is still set, then (4)
won't happen, I think.  Instead, redisplay will recenter point in the
window.

> But if redisplay were aware of intangible text, it would handle both -
> the intangible property and the scroll margin - in (2) and there would
> be no need to enter the (3)-(4) rigmarole.

Good luck implementing that!  We already have a thick forest of
conflicting goals in that area, due to requirements for scroll-margin,
scroll-*-aggressively, scroll-conservatively, and scroll-step.

> Note that (3) means we have to search all text/overlay properties of
> every window that gets redisplayed for the sole purpose of detecting the
> presence of intangible text.  In my estimate 99.99% of our windows don't
> contain such text.

We already do precisely that, just in another place, where we move
point.  That was the issue that triggered this thread in the first
place.  Stefan's intent is to lower the number of such searches, by
only doing that for position of point that will be actually shown to
the user, whereas today we do that for interim positions that will
never be displayed.



  reply	other threads:[~2015-03-21 10:42 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15 19:53 Can we make set_point_both less expensive? Daniel Colascione
2015-03-16  3:02 ` Stefan Monnier
2015-03-16  3:32   ` Daniel Colascione
2015-03-16 12:49     ` Stefan Monnier
2015-03-16 16:24       ` Eli Zaretskii
2015-03-16 17:42         ` Stefan Monnier
2015-03-16 18:03         ` Artur Malabarba
2015-03-16  3:48   ` Eli Zaretskii
2015-03-16 12:47     ` Stefan Monnier
2015-03-16 16:23       ` Eli Zaretskii
2015-03-16 17:36         ` Stefan Monnier
2015-03-16 18:05           ` Eli Zaretskii
2015-03-16 18:18             ` Daniel Colascione
2015-03-16 18:27               ` Eli Zaretskii
2015-03-16 18:31                 ` Daniel Colascione
2015-03-16 19:42                   ` Eli Zaretskii
2015-03-16 20:43                     ` Daniel Colascione
2015-03-16 20:48                       ` Lennart Borgman
2015-03-16 20:53                         ` Daniel Colascione
2015-03-16 22:00                           ` Stefan Monnier
2015-03-17  7:08                       ` Eli Zaretskii
     [not found]                     ` <<5507408D.1040104@dancol.org>
     [not found]                       ` <<83h9tkyucg.fsf@gnu.org>
2015-03-17 15:11                         ` Drew Adams
2015-03-16 18:57             ` Stefan Monnier
2015-03-17 10:25               ` martin rudalics
2015-03-17 15:38                 ` Stefan Monnier
2015-03-17 19:27                   ` martin rudalics
2015-03-17 21:37                     ` Stefan Monnier
2015-03-18  7:36                       ` martin rudalics
2015-03-18 12:55                         ` Stefan Monnier
2015-03-18 19:05                           ` martin rudalics
2015-03-18 19:24                             ` Stefan Monnier
2015-03-19  7:51                               ` martin rudalics
2015-03-19 13:41                                 ` Stefan Monnier
2015-03-20  8:08                                   ` martin rudalics
2015-03-20 14:14                                     ` Stefan Monnier
2015-03-20 14:20                                       ` Lennart Borgman
2015-03-20 14:32                                       ` Eli Zaretskii
2015-03-20 14:48                                       ` martin rudalics
2015-03-20 15:08                                         ` Eli Zaretskii
2015-03-20 17:57                                           ` Stefan Monnier
2015-03-20 20:52                                             ` Eli Zaretskii
2015-03-20 21:50                                               ` Stefan Monnier
2015-03-21  7:32                                                 ` Eli Zaretskii
2015-03-21  9:58                                                   ` martin rudalics
2015-03-21 10:43                                                     ` Eli Zaretskii
2015-03-21 12:30                                                       ` martin rudalics
2015-03-21 12:45                                                         ` Eli Zaretskii
2015-03-20 19:53                                           ` martin rudalics
2015-03-20 21:19                                             ` Eli Zaretskii
2015-03-20 21:53                                               ` Stefan Monnier
2015-03-21  7:38                                                 ` Eli Zaretskii
2015-03-21  9:59                                                   ` martin rudalics
2015-03-21 10:46                                                     ` Eli Zaretskii
2015-03-21 10:56                                                       ` Eli Zaretskii
2015-03-21 12:31                                                       ` martin rudalics
2015-03-21 14:03                                                       ` Stefan Monnier
2015-03-21 14:44                                                         ` Eli Zaretskii
2015-03-21 17:28                                                           ` Stefan Monnier
2015-03-21 18:28                                                             ` Eli Zaretskii
2015-03-21 22:14                                                               ` Stefan Monnier
2015-03-22 14:11                                                                 ` martin rudalics
2015-03-22 22:25                                                                   ` Stefan Monnier
2015-03-21 13:59                                                   ` Stefan Monnier
2015-03-21 14:35                                                     ` Stefan Monnier
2015-03-21 14:47                                                       ` Eli Zaretskii
2015-03-21 17:10                                                         ` Stefan Monnier
2015-03-21 17:14                                                           ` Eli Zaretskii
2015-03-21 22:12                                                             ` Stefan Monnier
2015-03-22  3:34                                                               ` Eli Zaretskii
2015-03-22 13:58                                                                 ` Stefan Monnier
2015-03-22 17:41                                                                   ` Eli Zaretskii
2015-03-22 22:23                                                                     ` Stefan Monnier
2015-03-23 15:31                                                                       ` Eli Zaretskii
2015-03-23 19:27                                                                         ` Stefan Monnier
2015-03-23 19:28                                                                         ` Stefan Monnier
2015-03-23 19:39                                                                           ` Eli Zaretskii
2015-03-23 21:37                                                                             ` Stefan Monnier
2015-03-21 14:42                                                     ` Eli Zaretskii
2015-03-21  9:58                                                 ` martin rudalics
2015-03-21 14:10                                                   ` Stefan Monnier
2015-03-21  9:58                                               ` martin rudalics
2015-03-21 10:42                                                 ` Eli Zaretskii [this message]
2015-03-21 12:30                                                   ` martin rudalics
2015-03-21 12:45                                                     ` Eli Zaretskii
2015-03-20 17:59                                         ` Stefan Monnier
2015-03-20 19:53                                           ` martin rudalics
2015-03-17 14:29       ` Richard Stallman
2015-03-17 15:15         ` Yuri Khan
2015-03-17 15:33           ` Eli Zaretskii
2015-03-18 12:00           ` Richard Stallman

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=83mw36tywa.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=rudalics@gmx.at \
    /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.