emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A solution to display completion candidates after point in a minibuf


From: Eli Zaretskii
Subject: Re: A solution to display completion candidates after point in a minibuffer
Date: Fri, 02 Oct 2020 19:04:56 +0300

> Date: Fri, 02 Oct 2020 15:36:37 +0000
> From: Gregory Heytings via "Emacs development discussions." 
> <emacs-devel@gnu.org>
> 
> (defvar-local start-display-at-beginning-of-minibuffer nil)
> (defun start-display-at-beginning-of-minibuffer (&rest args)
>    (when (and start-display-at-beginning-of-minibuffer (minibufferp))
>      (set-window-start-at-begin 1 (point))))
> (defun set-window-start-at-begin (beg end)
>    (set-window-start nil beg)
>    (unless (pos-visible-in-window-p end nil t) (set-window-start-at-begin (+ 
> beg (/ (- end beg) 2)) end)))
> (setq window-scroll-functions (cons 'start-display-at-beginning-of-minibuffer 
> window-scroll-functions))
> (add-hook 'post-command-hook 'start-display-at-beginning-of-minibuffer)
> 
> This works with at least Emacs 24, 25, 26, 27 and 28.

Thanks, but I don't like such solutions, because they attempt to work
around the display engine in order to do something, instead of asking
the display engine itself to do that for us.

In bug#43572, a solution that would allow us to ask the display engine
to do this is being discussed.  I'd favor one of the solutions
proposed there lately, namely, to indicate in the text to be displayed
that this text wants to be displayed with the window-start set at BOB.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]