From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#34038: 26.1; set-window-start sometimes fails to set window start Date: Fri, 11 Jan 2019 16:10:45 +0100 Message-ID: <5C38B1F5.7040205@gmx.at> References: <83sgxzhe04.fsf@gnu.org> <87ef9je67i.fsf@metalevel.at> <83d0p3gvua.fsf@gnu.org> <8736pz8dus.fsf@metalevel.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1547219409 20784 195.159.176.226 (11 Jan 2019 15:10:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2019 15:10:09 +0000 (UTC) Cc: 34038@debbugs.gnu.org To: Markus Triska , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 11 16:10:05 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 1ghyRg-0005D5-3M for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Jan 2019 16:10:04 +0100 Original-Received: from localhost ([127.0.0.1]:47481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghyTm-0007D1-TY for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Jan 2019 10:12:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghyTb-0007Br-9r for bug-gnu-emacs@gnu.org; Fri, 11 Jan 2019 10:12:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghyTa-0007aH-K6 for bug-gnu-emacs@gnu.org; Fri, 11 Jan 2019 10:12:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ghyTa-0007a6-Gd for bug-gnu-emacs@gnu.org; Fri, 11 Jan 2019 10:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ghyTa-0001es-61 for bug-gnu-emacs@gnu.org; Fri, 11 Jan 2019 10:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Jan 2019 15:12: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.15472194656301 (code B ref 34038); Fri, 11 Jan 2019 15:12:02 +0000 Original-Received: (at 34038) by debbugs.gnu.org; 11 Jan 2019 15:11:05 +0000 Original-Received: from localhost ([127.0.0.1]:56262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghySf-0001dZ-GY for submit@debbugs.gnu.org; Fri, 11 Jan 2019 10:11:05 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:52247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghySd-0001d5-SO for 34038@debbugs.gnu.org; Fri, 11 Jan 2019 10:11:04 -0500 Original-Received: from [192.168.1.101] ([212.95.5.245]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MbxJ8-1h1IIR08PO-00JNkU; Fri, 11 Jan 2019 16:10:57 +0100 In-Reply-To: <8736pz8dus.fsf@metalevel.at> X-Provags-ID: V03:K1:TwpQCE2vBFEJRJ2nzushBJF/BptmqAQ8eEYusmfCHWT/RgiDRI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 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:154347 Archived-At: > I agree. However, that is not what I was requesting. What I need for my > use case is to reliably restore a configuration that I know is possible > to display on the grounds that it has already been displayed before. Is > there any way to do this, or could this please be provided? From you snippet I guess the following should do that. (progn (goto-char (point-max)) (insert "\n") (dotimes (x (window-height)) (insert (format "%s\n" x))) (redisplay) (let ((scroll-margin 1) (b (buffer-string)) (s (window-start)) (p (point))) (read-key "Please press a key to continue.") (erase-buffer) (insert b) (set-window-point nil p) (set-window-start nil s))) The crucial idiom is provided by the last two forms. Restore window's point first and then its start position (although any order should do in your case). martin