all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings via "Emacs development discussions." <emacs-devel@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: A solution to display completion candidates after point in a minibuffer
Date: Sat, 03 Oct 2020 12:31:54 +0000	[thread overview]
Message-ID: <alpine.NEB.2.22.394.2010031204590453.3676@sdf.lonestar.org> (raw)
In-Reply-To: <jwvv9fsea10.fsf-monnier+emacs@gnu.org>


>
> I'd be uneasy using such code without some vague understanding about 
> *why* it works.
>

I studied this in a bit more detail.

What happens in the normal case (with icomplete-mode, icomplete-separator 
set to "\n", and window-scroll-functions set to nil) is the following:

1. redisplay_internal() calls resize_mini_window() and 
redisplay_windows(),

2. redisplay_windows() calls redisplay_window_0(), which calls 
redisplay_window(), and the "recenter" part of redisplay_window() is 
executed.

This happens twice (for each window in the frame) before 
redisplay_internal() returns.  It happens twice because FRAME_GARBAGED_P, 
because the windows have been resized, which means that the "goto retry" 
jump is executed.  This means that run_window_scroll_functions() is called 
twice (which has of course no effect if window-scroll-functions is nil).

When window-scroll-functions is set to 
start-display-at-beginning-of-minibuffer, the same happens, except of 
course that start-display-at-beginning-of-minibuffer is executed twice. 
The first time the "recenter" part of redisplay_window() is executed, 
start-display-at-beginning-of-minibuffer sets w->force_start and w->start. 
Then resize_mini_window() sets w->start again, but redisplay_window() is 
called again, and this time it is its "force_start" part that is executed, 
which calls run_window_scroll_functions(), after which try_window() 
updates w->start to the window-start value set in window-scroll-functions.



      parent reply	other threads:[~2020-10-03 12:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 15:36 A solution to display completion candidates after point in a minibuffer Gregory Heytings via Emacs development discussions.
2020-10-02 16:04 ` Eli Zaretskii
2020-10-02 16:14   ` Gregory Heytings via Emacs development discussions.
2020-10-02 16:20     ` Eli Zaretskii
2020-10-02 16:32 ` Stefan Monnier
2020-10-02 17:17   ` Gregory Heytings via Emacs development discussions.
2020-10-02 19:24     ` Stefan Monnier
2020-10-02 20:18       ` Drew Adams
2020-10-02 21:30       ` Gregory Heytings via Emacs development discussions.
2020-10-02 22:44         ` Stefan Monnier
2020-10-02 23:11           ` Gregory Heytings via Emacs development discussions.
2020-10-03  0:10             ` Stefan Monnier
2020-10-03  6:59               ` Gregory Heytings via Emacs development discussions.
2020-10-03  9:04                 ` Eli Zaretskii
2020-10-04 16:11                   ` Gregory Heytings via Emacs development discussions.
2020-10-04 16:21                     ` Eli Zaretskii
2020-10-04 16:52                       ` Gregory Heytings via Emacs development discussions.
2020-10-04 17:00                         ` Eli Zaretskii
2020-10-03  8:25               ` Eli Zaretskii
2020-10-03  8:07         ` Eli Zaretskii
2020-10-02 22:40       ` Gregory Heytings via Emacs development discussions.
2020-10-03 12:31       ` Gregory Heytings via Emacs development discussions. [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=alpine.NEB.2.22.394.2010031204590453.3676@sdf.lonestar.org \
    --to=emacs-devel@gnu.org \
    --cc=ghe@sdf.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 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.