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: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: A solution to display completion candidates after point in a minibuffer
Date: Sun, 04 Oct 2020 16:11:06 +0000	[thread overview]
Message-ID: <alpine.NEB.2.22.394.2010041743170453.3982@sdf.lonestar.org> (raw)
In-Reply-To: <83sgavfzno.fsf@gnu.org>


>>>> I don't know, but I'm not sure about that.  If you (set-window-start 
>>>> nil 1) unconditionally in window-scroll-functions, this setting will 
>>>> be obeyed by redisplay, even if point is not visible anymore.
>>>
>>> Oh, indeed, in that case it would move point instead.
>>
>> No, that's not what I meant.  In that case redisplay does not scroll 
>> and does not move point.  Point simply becomes invisible.
>
> No, redisplay will never accept a result that point is invisible.  If it 
> ever does display such situations, it's a bug that needs to be fixed.
>

Never say never...

>> It becomes visible again after the next redisplay, a second or two 
>> later.
>
> If such a situation exists, please describe how to reproduce it, because 
> it's a bug we need to fix.  Emacs should never display a window where 
> point is not fully visible.
>

Here's a recipe:

emacs -Q
(defun recipe ()
   (interactive)
   (set-frame-width nil 80)
   (set-frame-height nil 30)
   (switch-to-buffer (get-buffer-create "*Recipe*"))
   (goto-char 1)
   (let ((i 0)) (while (< i 60) (setq i (1+ i)) (insert (format "L%d\n" i))))
   (goto-char 148)
   (sit-for 0.25)
   (add-hook 'window-scroll-functions (lambda (&rest args) (set-window-start nil 1)))
   (forward-line 13))
M-x recipe
press C-n

You will see the cursor on the first line, after "L1", but in fact point 
is at that moment not visible anymore, it is still on "L54".  A second or 
two later, point has actually moved, and you will see the cursor blinking 
on "L14".  This works at least with Emacs 23, 24, 25, 26, 27 and 28.

The bug is more visible with Emacs 23 and 24, because you don't see the 
cursor on the first line after pressing C-n, you see a window without any 
cursor during a second or two.  With Emacs 25, 26, 27 and 28 the cursor 
after "L1" does not correspond to point (and as far as I understand does 
not correspond to anything).



  reply	other threads:[~2020-10-04 16:11 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. [this message]
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.

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.2010041743170453.3982@sdf.lonestar.org \
    --to=emacs-devel@gnu.org \
    --cc=eliz@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.