From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#34038: 26.1; set-window-start sometimes fails to set window start Date: Sat, 12 Jan 2019 14:25:57 +0100 Message-ID: <87fttydn2y.fsf@metalevel.at> References: <83sgxzhe04.fsf@gnu.org> <87ef9je67i.fsf@metalevel.at> <83d0p3gvua.fsf@gnu.org> <8736pz8dus.fsf@metalevel.at> <5C38B1F5.7040205@gmx.at> <87o98nf5pq.fsf@metalevel.at> <5C39A17B.8030204@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1547299753 22597 195.159.176.226 (12 Jan 2019 13:29:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 12 Jan 2019 13:29:13 +0000 (UTC) User-Agent: Emacs/24.5 Cc: 34038@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 12 14:29:09 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1giJLY-0005lN-Td for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Jan 2019 14:29:09 +0100 Original-Received: from localhost ([127.0.0.1]:57468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giJNg-0006pB-0r for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Jan 2019 08:31:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giJNL-0006bo-HO for bug-gnu-emacs@gnu.org; Sat, 12 Jan 2019 08:31:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giJJX-0008TM-0A for bug-gnu-emacs@gnu.org; Sat, 12 Jan 2019 08:27:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1giJJW-0008TC-Sd for bug-gnu-emacs@gnu.org; Sat, 12 Jan 2019 08:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1giJJW-0008IP-K2 for bug-gnu-emacs@gnu.org; Sat, 12 Jan 2019 08:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Markus Triska Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Jan 2019 13:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34038 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 34038-submit@debbugs.gnu.org id=B34038.154729956331823 (code B ref 34038); Sat, 12 Jan 2019 13:27:02 +0000 Original-Received: (at 34038) by debbugs.gnu.org; 12 Jan 2019 13:26:03 +0000 Original-Received: from localhost ([127.0.0.1]:56615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1giJIY-0008HC-TU for submit@debbugs.gnu.org; Sat, 12 Jan 2019 08:26:03 -0500 Original-Received: from metalevel.at ([78.46.218.83]:49072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1giJIV-0008Gk-1B for 34038@debbugs.gnu.org; Sat, 12 Jan 2019 08:25:59 -0500 Original-Received: by metalevel.at (Postfix, from userid 1000) id 6387CA0227; Sat, 12 Jan 2019 14:25:57 +0100 (CET) In-Reply-To: <5C39A17B.8030204@gmx.at> (martin rudalics's message of "Sat, 12 Jan 2019 09:12:43 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154379 Archived-At: martin rudalics writes: > All we need to know for why this happens would be the exact sequence > of (window) point and window start settting operations performed by > that application. The actual application performs actions that are quite involved, so I try to break it down to simpler cases that need fewer operations. For example, please try the following snippet: (progn (goto-char (point-max)) (insert "\n") (dotimes (x (window-height)) (insert (format "%s\n" x))) (let ((b (buffer-string)) (p (point))) (redisplay) (set-window-start nil p) (let ((wp (window-point))) (read-key "Step 1. Please press a key to continue.") (dotimes (x (round (/ (window-height) 2))) (insert (format "more lines ... %s\n" x))) (read-key "Step 2. Please press a key to continue.") (erase-buffer) (insert b) (set-window-point nil wp) (set-window-start nil p)))) In this snippet, I try to restore the exact same configuration that you see when "Step 1 ..." is displayed, i.e., window-start is set so that point is on the very first line, which is blank. When you press a key at this point, then a few more lines of text are inserted. Then, please press another key when "Step 2 ..." is displayed. What I observe after these forms is that point is unexpectedly placed vertically centered in the window instead of at the topmost line. Please note that I am now using set-window-point, and also set-window-start with third argument (implicitly) nil. I get the exact same result when I use t for the third argument of set-window-start. Can you reproduce this? Is there a way to reliably restore this? Thank you and all the best! Markus