all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: larsi@gnus.org, esabof@gmail.com, 14582@debbugs.gnu.org
Subject: bug#14582: 24.3.50.1; Strange overlay behavior, when window-start is inside an overlay.
Date: Fri, 11 Feb 2022 10:46:31 +0200	[thread overview]
Message-ID: <83tud5ssd4.fsf@gnu.org> (raw)
In-Reply-To: <87wni2ypx7.fsf@web.de> (message from Michael Heerdegen on Fri, 11 Feb 2022 05:42:44 +0100)

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Cc: larsi@gnus.org,  esabof@gmail.com,  14582@debbugs.gnu.org
> Date: Fri, 11 Feb 2022 05:42:44 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > That's not what make-window-start-visible means.  It means "if the
> > current window-start is invisible, try to find an alternative
> > window-start that would be visible, while still showing point".
> >
> > Your interpretation of the setting is simply impossible to implement:
> > the display engine cannot possibly do anything to uncover the hidden
> > window-start point without scrolling the window in some way.  So
> > _something_ that was visible before must become invisible after,
> > because we scroll the window.
> 
> I'm irritated that the newly chosen window-start can be after the
> original position.  I don't know any use case where this is useful, and
> it was only irritating whenever it happened in my test.  Is this
> unavoidable?

It isn't unavoidable, but doing something more sophisticated would
call for a significantly more complex code.  The current solution for
when this variable is set and the window-start point is invisible is
very simple: we recenter the window around point.  The recentering
method is safe, because it always succeeds, which is why it also
serves as the fallback method of finding the suitable window-start for
redisplaying a window.  The code that implements the recentering was
already there, so the introduction of this new variable boiled down to
recognizing the conditions under which we should go directly to
recentering, bypassing all the other methods.

Anything else would mean a much deeper surgery on the (already
non-trivially complex) logic of redisplaying a window, whereby we both
verify that the previous window-start is still usable, and try various
optimizations to make the redrawing itself as cheap as possible.

> BTW, why does the adjustment happen when I just move the cursor inside
> the displayed window content without causing any display change?  The
> new heuristic seems to depend on the value of `point' (I don't mean
> values that would cause scrolling the normal way).

You may be unaware, but moving point always triggers redisplay of the
window.  That eventually nothing happens on the screen except showing
the cursor at a different location is because Emacs is smart enough to
detect that nothing else needs to change.  IOW, it's not like
redisplay is being explicitly told that only point moved, and moved
slightly enough to allow the same window-start to be used, it has to
deduce that by itself.

When this new variable is set, and the window-start is hidden, Emacs
falls back on recentering the window around point.  If point is closer
to BOB than half the window, recentering will normally fail to find a
better window-start that would show point at the center of the window,
but when point is farther than half the window, Emacs will scroll the
window as result of recentering.  That's why you see the dependance on
point position.

Once again, this option was intended to be used in relatively rare
situations.  I do not recommend to set it by default, especially if
the side effects annoy you.





  reply	other threads:[~2022-02-11  8:46 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09  9:13 bug#14582: 24.3.50.1; Strange overlay behavior, when window-start is inside an overlay E Sabof
2013-06-09 17:06 ` Eli Zaretskii
2013-06-09 17:37   ` E Sabof
2013-06-09 17:52     ` Eli Zaretskii
2013-06-09 18:16       ` E Sabof
2013-06-09 18:25         ` Eli Zaretskii
2013-06-09 18:40           ` E Sabof
2013-06-09 18:49             ` E Sabof
2022-01-30 21:37             ` Lars Ingebrigtsen
2022-01-31  0:36               ` Michael Heerdegen
2022-01-31 14:57                 ` Eli Zaretskii
2022-01-31 18:42                   ` Michael Heerdegen
2022-01-31 19:08                     ` Eli Zaretskii
2022-02-01  3:03                       ` Michael Heerdegen
2022-02-01 18:18                         ` Eli Zaretskii
2022-02-02  1:12                           ` Michael Heerdegen
2022-02-02  3:34                             ` Eli Zaretskii
2022-02-02  4:02                               ` Michael Heerdegen
2022-02-02 12:31                                 ` Eli Zaretskii
2022-02-03 17:40                                   ` Eli Zaretskii
2022-02-04  1:37                                     ` Michael Heerdegen
2022-02-04 13:56                                       ` Eli Zaretskii
2022-02-06  2:54                                         ` Michael Heerdegen
2022-02-06 10:28                                           ` Eli Zaretskii
2022-02-08  0:29                                             ` Michael Heerdegen
2022-02-08  3:34                                               ` Eli Zaretskii
2022-02-08  4:05                                                 ` Michael Heerdegen
2022-02-08 12:23                                                   ` Eli Zaretskii
2022-02-09  0:20                                                     ` Michael Heerdegen
2022-02-09  3:53                                                     ` Michael Heerdegen
2022-02-09 13:47                                                       ` Eli Zaretskii
2022-02-10  1:07                                                         ` Michael Heerdegen
2022-02-10  6:15                                                           ` Eli Zaretskii
2022-02-11  4:42                                                             ` Michael Heerdegen
2022-02-11  8:46                                                               ` Eli Zaretskii [this message]
2022-02-12  0:25                                                                 ` Michael Heerdegen
2022-02-12  7:28                                                                   ` Eli Zaretskii
2022-02-12 22:53                                                                     ` Michael Heerdegen
2022-02-13 11:43                                                                       ` Eli Zaretskii
2022-02-27  3:54                                                                         ` Michael Heerdegen
2022-02-27  8:08                                                                           ` Eli Zaretskii
2022-02-27 23:19                                                                             ` Michael Heerdegen
2022-02-28 13:10                                                                               ` Eli Zaretskii
2022-01-31 15:30                 ` Lars Ingebrigtsen

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=83tud5ssd4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=14582@debbugs.gnu.org \
    --cc=esabof@gmail.com \
    --cc=larsi@gnus.org \
    --cc=michael_heerdegen@web.de \
    /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.