From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Redisplay resets vscroll when window start changes Date: Tue, 16 Nov 2021 22:40:35 -0500 Message-ID: References: <87k0h9pp7t.fsf.ref@yahoo.com> <87k0h9pp7t.fsf@yahoo.com> <83r1bhsdsn.fsf@gnu.org> <87tugdnf1x.fsf@yahoo.com> <831r3g2rhe.fsf@gnu.org> <87tugcuuoz.fsf@yahoo.com> <87o86kuuek.fsf@yahoo.com> <83r1bg1ay4.fsf@gnu.org> <87zgq4te32.fsf@yahoo.com> <83mtm41afl.fsf@gnu.org> <875yssufhf.fsf@md5i.com> <87czmztynn.fsf@yahoo.com> <83wnl7zcej.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17304"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Po Lu , mwd@md5i.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 17 04:41:45 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mnBpQ-0004K2-Ol for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Nov 2021 04:41:44 +0100 Original-Received: from localhost ([::1]:58098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnBpP-0005NO-DG for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Nov 2021 22:41:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnBoS-0004bS-TL for emacs-devel@gnu.org; Tue, 16 Nov 2021 22:40:44 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnBoQ-0005th-2q; Tue, 16 Nov 2021 22:40:44 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A6816441929; Tue, 16 Nov 2021 22:40:39 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7F55444190F; Tue, 16 Nov 2021 22:40:37 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1637120437; bh=3B3yS6aJoL8LENzxwSVgdplyLRDu2KN92SLvMefuJmw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=HkZ6cyuF6W/e+XYX9Tkjf33y3+Idnpl+l37n+mUvU98k9gV7oYXjdgrp09Ope+Cae 2XbHXirFU1NagQiHiTjJbU8c882gttQEWGfL2wcdb7Tz4yWfz4KNNlqfehnq5J+Aoq ADI/k6ZUycKa1ubLwO68e3rNVFt7xVgx5qAiJAshErqTecsHz/1MXYxWX8N/nGc8vc aPDMIpKYP/O+8EnciZuQzL/Z1Z6eZNJ8HsdyP27/Ib6K1NoiNQTJI7b0aWeSuewwQk DmZMLjS3R4d7pCtm9yuppFdYUun4OkubbXUfjQTCveG7SYG4WLEq22Uoc0VMRpNVtn WqtNek5kRi7lg== Original-Received: from pastel (unknown [45.72.128.33]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4A4CF1204A2; Tue, 16 Nov 2021 22:40:37 -0500 (EST) In-Reply-To: <83wnl7zcej.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 17 Nov 2021 05:31:00 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279592 Archived-At: Eli Zaretskii [2021-11-17 05:31:00] wrote: > My suggestion is to implement equivalents of C-n/C-p that do what you > want, instead of asking for previous/next-line to be able to preserve > the vscroll, because those commands aren't supposed to support the use > case you want to support. [ I feel somewhat responsible for this mess, since IIRC I was the one who first tried to write a line-move that preserves the pixel-column, by using the redisplay iterator code, without understand very much of what it does or how it works. ] I'm still not sure how/why line-move should affect vscroll. AFAIK while line-move does use some of the redisplay code, in theory at least its effect should only ever be to move point (i.e. when called within a `save-excursion` it should end up having no effect at all). Would there be a way to distinguish the case where line-move can return a correct result without changing vscroll, from the case where it does require changing vscroll in order to find its answer? Stefan