bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#34038: 26.1; set-window-start sometimes fails to set window start


From: Markus Triska
Subject: bug#34038: 26.1; set-window-start sometimes fails to set window start
Date: Thu, 10 Jan 2019 20:57:28 +0100

To reproduce this issue, please start Emacs with "$ emacs -Q" and paste
at the end of the *scratch* buffer the following form:

    (progn
      (goto-char (point-max))
      (insert "\n")
      (dotimes (x (window-height))
        (insert (format "%s\n" x)))
      (redisplay)
      (let ((b (buffer-string))
            (p (point)))
        (set-window-start nil p t)
        (read-key "Please press a key to continue.")
        (erase-buffer)
        (insert b)
        (set-window-start nil p t)))

Then, put point at the end of the form, and evaluate it with C-x C-e.

Conceptually, this program:

     1) inserts several (i.e, window-height) lines into the buffer
     2) sets window point to p, which is point after (1)
     3) WAITS FOR A KEY PRESS (please press a key at this point)
     4) erases and restores the buffer contents
     5) sets window point to p, the same point as in (2)

However, in many invocations (please try it repeatedly if necessary),
the visible portion of the buffer unexpectedly differs between (3) and
after the whole procedure.

In other words, when Emacs waits for a key press, a different portion of
the buffer is visible compared to after you press a key, even though
window-start is set to the same position in both cases.

Is there a way to reliably set the window-start in such situations?

Thank you very much!
Markus

In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2018-11-18 built on debian
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description:     Debian GNU/Linux 9.6 (stretch)





reply via email to

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