unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34038: 26.1; set-window-start sometimes fails to set window start
@ 2019-01-10 19:57 Markus Triska
  2019-01-11  7:03 ` Eli Zaretskii
  0 siblings, 1 reply; 34+ messages in thread
From: Markus Triska @ 2019-01-10 19:57 UTC (permalink / raw)
  To: 34038


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)





^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2019-04-06  8:23 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <<m2ftu05lqv.fsf@metalevel.at>
     [not found] ` <<83sgxzhe04.fsf@gnu.org>
2019-01-11 16:37   ` bug#34038: 26.1; set-window-start sometimes fails to set window start Drew Adams
2019-01-11 16:49     ` Eli Zaretskii
2019-01-10 19:57 Markus Triska
2019-01-11  7:03 ` Eli Zaretskii
2019-01-11 12:20   ` Markus Triska
2019-01-11 13:36     ` Eli Zaretskii
2019-01-11 14:31       ` Markus Triska
2019-01-11 15:10         ` martin rudalics
2019-01-11 17:45           ` Markus Triska
2019-01-11 19:07             ` Eli Zaretskii
2019-01-12  8:12             ` martin rudalics
2019-01-12 13:25               ` Markus Triska
2019-01-12 13:53                 ` Eli Zaretskii
2019-01-12 14:12                 ` martin rudalics
2019-01-12 19:08                   ` Markus Triska
2019-01-12 20:28                     ` Eli Zaretskii
2019-01-11 21:23     ` Alan Mackenzie
2019-01-12  8:13       ` martin rudalics
2019-01-12 18:22         ` Alan Mackenzie
2019-01-12 20:29           ` Eli Zaretskii
2019-01-12 20:42             ` Alan Mackenzie
2019-01-13  3:30               ` Eli Zaretskii
2019-01-13  7:32       ` Markus Triska
2019-01-13  8:40         ` martin rudalics
2019-01-13 11:32           ` Eli Zaretskii
2019-01-13 13:40             ` martin rudalics
2019-01-13 15:21               ` Eli Zaretskii
2019-03-24 10:35                 ` Markus Triska
2019-03-24 17:28                   ` Eli Zaretskii
2019-03-24 19:56                     ` Markus Triska
2019-03-28 16:21                       ` Eli Zaretskii
2019-03-29  7:16                         ` Markus Triska
2019-03-29  8:29                           ` Eli Zaretskii
2019-04-06  8:23                             ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).