From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Scrolling commands and skipping redisplay, was: Re: emacs rendering comparisson between emacs23 and emacs26.3 Date: Mon, 20 Apr 2020 20:04:06 +0300 Message-ID: References: <20200403174757.GA8266@ACM> <838sj8sphk.fsf@gnu.org> <834ktwsmfw.fsf@gnu.org> <83imibqsmm.fsf@gnu.org> <478c2aab-a5fc-61c2-02e2-2d9846b95273@yandex.ru> <83v9m9nltx.fsf@gnu.org> <83tv1rn8fx.fsf@gnu.org> <4f8bb277-b376-97bf-8539-799688d8e66d@yandex.ru> <83eesvmj15.fsf@gnu.org> <6eec7f68-770e-b3b1-4627-6222f3ef7216@yandex.ru> <83ftd9kwlu.fsf@gnu.org> <1de9d24f-eeb7-7d0a-3768-4baba4365066@yandex.ru> <83zhbcdmyi.fsf@gnu.org> <61f565cd-4fee-d48c-a9ef-b78419b3d058@yandex.ru> <83wo6ed4kb.fsf@gnu.org> <464b5639-7790-fdbc-b519-22a6b0e8c016@yandex.ru> <83o8rqaucp.fsf@gnu.org> <551c7634-f614-c5a7-c089-33a0dc56574d@yandex.ru> <83imhyaqyw.fsf@gnu.org> <3ddcec07-079f-18e8-81a7-76eaf9a8187a@yandex.ru> <83a737i9bx.fsf@gnu.org> <83mu76gq03.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="57236"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Cc: acm@muc.de, rrandresf@gmail.com, emacs-devel@gnu.org, rms@gnu.org, rudalics@gmx.at To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 20 19:05:54 2020 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 1jQZrl-000Emz-Ed for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Apr 2020 19:05:53 +0200 Original-Received: from localhost ([::1]:39568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQZrk-0006mN-HT for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Apr 2020 13:05:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56444 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQZqA-0005Ig-O0 for emacs-devel@gnu.org; Mon, 20 Apr 2020 13:04:15 -0400 Original-Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQZq9-0004xd-Sq for emacs-devel@gnu.org; Mon, 20 Apr 2020 13:04:14 -0400 Original-Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39261) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQZq9-0004vw-Cm; Mon, 20 Apr 2020 13:04:13 -0400 Original-Received: by mail-wr1-x431.google.com with SMTP id b11so13098577wrs.6; Mon, 20 Apr 2020 10:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=txnTN/441M1YEJiUiW5OA6yKZLLTcLr6fG1hqmFUNJc=; b=ien0r7D5NSTmHKlabaQ5+OAz7suf7ARjByjsgobYqJoW2cAnk0e2BNZk+34LbHhp+x LJLvpkVwrHJnXB866ypiYENAmHGrLbmI9lLuNX6QKN847PRF9keMZ0UtUcz5cJugDtBI bayAhJ4D83BWfJrrQTJtq30KFqjbC/EA9gkeFd2aAurFbfaLqtJohhjMqSGsEagR6DKu 6kZVfuryBgiDXHpup3KN6TH+x8cci/JOaSarKAfZypXriONzWNaRr/Q4fx5xL/yJfcq/ V6l3zoSm1qEwUdJke1fUUlui/5AYOjJcRTr49A3xVzn6X7TAoOYm6QA/dYNkiipFmRwx PvDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=txnTN/441M1YEJiUiW5OA6yKZLLTcLr6fG1hqmFUNJc=; b=VOFGv/E5vNVqRelqL09pq+0TKQY68oB6yaKTt5PoLoXY5s0I7EUcG/MyOthxaHg16w +iTBCvomacksUVs54JrK6OSlD1Tz9b3Y+9HmOF9VOTSC3b9RziSqwoQyOZaJzLT+uiyH 8j+U9YEIn3BSLKGZn9IKVtnTGslQpkA5SBKWzoOgQ2E4U4Yy+mqCZr6xJT1VawIEJLes 7VndPVh0304LcvCi6pfCL5fy+z0iRNttIHQb1OqzFJpCXfG8tVDGCvVxPRUvbXysiI67 Ezt4HZNwPjKi2EK2XSAM3ugIN5JT8L8BNnklkb3hdn+wA8QR5ZB0d2ezm2Js5S7+k0vP VnXQ== X-Gm-Message-State: AGi0PuY4+0Iomt26kNg7ccvj4eV+r3PUyqSyMLw9WKzMgYfC2UJfKDXS A8BHpt7fMhPLC8tlMJAsVQDphEp745A= X-Google-Smtp-Source: APiQypLJCh6i7D6hu9/rmBoMdw7avCDGZsnAXcdvJYmAeBNBU/HhvHSBpcAYudoUPjsUsy4AA3hOBw== X-Received: by 2002:a5d:6985:: with SMTP id g5mr16636478wru.398.1587402249898; Mon, 20 Apr 2020 10:04:09 -0700 (PDT) Original-Received: from [192.168.0.2] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id f23sm79594wml.4.2020.04.20.10.04.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Apr 2020 10:04:08 -0700 (PDT) In-Reply-To: <83mu76gq03.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=raaahh@gmail.com; helo=mail-wr1-x431.google.com X-detected-operating-system: by eggs1p.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::431 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:247404 Archived-At: On 20.04.2020 18:01, Eli Zaretskii wrote: >>> It's not a "merge" and not an optimization, it's how Emacs was >>> designed. It only enters redisplay when it's idle. If you invoke >>> commands one after another quickly enough, more than one command will >>> be executed before the next redisplay cycle. >> >> The fact that Emacs's behavior can depend on when redisplay happens, and >> the user cannot reliably control it, is problematic IMHO. > > Please be specific: what Emacs's behavior can depend on when redisplay > happens, apart from whether something was or wasn't updated on > display? The window's scroll position. Again: you (setq scroll-conservatively 1) and lean on C-n for a little while. Depending on whether Emacs manages to redisplay after every command invocation, the point will, or will not, scroll to the middle of the window. It could do that several times as well. >>>> At the beginning of each command, we can save the value of point. If, at >>>> the end, we're still in the same buffer, and the new value of point >>>> fails the scroll-conservatively check, count the lines between the >>>> previous value of point and the new one. If that number is <= >>>> scroll-conservatively, then scroll "conservatively" anyway. >>> >>> And if not, then what? >> >> Then give up and move point to the middle of the window. > > But that's again "not good" according to your opinion, isn't it? Why wouldn't my suggestion be good enough? > Or > maybe you assume this will solve most of the cases when we currently > recenter under scroll-conservatively < 101? All important ones, yes. >>> Anyway, scrolling commands don't normally move point, they move the >>> window-start. Point then moves because redisplay brings it into >>> view. So I don't think your algorithm will work, at least not in the >>> usual case. >> >> I'm a lot less worried about scrolling "conservatively" when the user >> actually invokes the scrolling commands. > > Ahem... the thread's title begins with "scrolling commands",so I > thought we were still discussing that? The amount of times I have mentioned 'C-n' might have persuaded otherwise. >>> What you describe might be relevant to "scrolling" that happens if you >>> lean on C-n, not on C-v. >> >> C-n, or C-M-e, or C-s. These are indeed scenarios when the current >> behavior can be most surprising. > > Is it? Just out of habit, I suppose. What Emacs does make a lot of > sense: it shows you the optimal amount of context. By contrast, > scroll-conservatively shows you only one side of that context, and > usually the wrong side. Are we going to argue whether scroll-conservatively is useful? I hope not. And if didn't assign value to that "optimal amount of context" thing you mention, I'd be arguing in favor of making scroll-conservatively a boolean instead.