From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.help Subject: Re: Set-window-vscroll sometimes doesn't work Date: Tue, 20 Oct 2020 14:19:46 -0400 Message-ID: <1B858755-4CAE-4E06-B867-098B323EF79E@gmail.com> References: <72B62847-3F35-412A-9F74-88442A936B19@gmail.com> <83eelvsivm.fsf@gnu.org> <853C8CD1-B58B-4F22-A889-4AB2AEE3DD80@gmail.com> <83imb7qw46.fsf@gnu.org> <66013ADF-731C-4922-8AF7-EAFDBF43C33C@gmail.com> <83ft6bqv0q.fsf@gnu.org> <4F2C1811-940E-4C58-8EE0-37AA3B666E12@gmail.com> <835z77qr3f.fsf@gnu.org> <834kmrq7gy.fsf@gnu.org> <83blgyp4k2.fsf@gnu.org> <4F794407-585E-4C74-85F3-00A668FB9675@gmail.com> <834kmqp1ts.fsf@gnu.org> <835z74ope5.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39718"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 20 20:21:20 2020 Return-path: Envelope-to: geh-help-gnu-emacs@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 1kUwG7-000ACC-6W for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 20 Oct 2020 20:21:19 +0200 Original-Received: from localhost ([::1]:53966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUwG6-00014J-4z for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 20 Oct 2020 14:21:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUwEj-000141-8b for help-gnu-emacs@gnu.org; Tue, 20 Oct 2020 14:19:54 -0400 Original-Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]:43697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUwEg-0006wf-9s; Tue, 20 Oct 2020 14:19:52 -0400 Original-Received: by mail-qt1-x831.google.com with SMTP id e6so1886019qtw.10; Tue, 20 Oct 2020 11:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KFxHwiJ4lQQOLbX4yVVmsICJiv6Z+/7eE9pelKWNXOI=; b=TX4pCsdb6RSKtRynIIwcqN19dI8AUGJjk4uCugbaQXk/SX4XG+UKkMHGoVXghAXNEI gr+tUVvKCoa4RRcnALNLUFgVlFhRmplkM8U6syjjQgofrY6h7P1qtaPOjysJBXI/gOAm cpyhaK+w1eVNGKI5+pXTJ5XxS+Cww5yuPPStUXcG++FEC1zYGoWksEuasXlK5Qzt5Qsb LNy//vqs0n+HzatroMKZIN5vqevbJnANMRf2Urttq0TfGIapPDsZWudJO7xtAb4lSvmi N2Z/sMQQ6YDYO7XzQSQh26NSpr2qUWxddGxSwNpJnS/C0VQ1vuTe/G9rd/b+1JFjRS5f /v8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KFxHwiJ4lQQOLbX4yVVmsICJiv6Z+/7eE9pelKWNXOI=; b=XlsxJqOxDcvOhNM0M9v/5MJ4NWneLIJSp2u88+oagm0NSqDq5I13rLgKA5TC9p6QSL UG/zuH8qNlNSW6Y0kVgX/CwxzreGFyydhvxj75rEXYWDh2+ad50nECfOuLzEwPNqeT+b ClZ5xgIQ/Ite1xzrAyTun3MLMg2mOAqSYbHC7S/48VqHSzGDHyG6u+4zN3w+E4jGVa09 lG4bvyiCmjC5Ez78oXj5ydMO9Bmsv/evShuHQCz/6SA8w/KDHM/4/iosPVjZLy9scYou dnk/8RiXaWmLo7+C4te2OvI7AFT7sVh+e9uKgZrQfblAdh6hrAwuIf1KhLokqMjOSnyu xh7Q== X-Gm-Message-State: AOAM532zuYEcgX7udrs3Dhw4dXmPmgLssS+Vkzr1Jl+uD1bBlmni4xEb aIkpFoIv2k13TnjAXW6ONFYmL5aWyNIIH4ip X-Google-Smtp-Source: ABdhPJxgqkvzAuN6Q8zYpGkBnQU8lYzQtKjZ22eJVJwUxZYoboEIE2iWq2OqZ2LMKkxpmVsxd7NdqQ== X-Received: by 2002:ac8:7a61:: with SMTP id w1mr3514488qtt.356.1603217988595; Tue, 20 Oct 2020 11:19:48 -0700 (PDT) Original-Received: from [192.168.1.10] (c-174-60-229-153.hsd1.pa.comcast.net. [174.60.229.153]) by smtp.gmail.com with ESMTPSA id o193sm1115058qke.12.2020.10.20.11.19.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Oct 2020 11:19:47 -0700 (PDT) In-Reply-To: <835z74ope5.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) Received-SPF: pass client-ip=2607:f8b0:4864:20::831; envelope-from=casouri@gmail.com; helo=mail-qt1-x831.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124596 Archived-At: >=20 > You could write a function that scrolls by 1 screen line, either by > scroll-up/down or with vscroll, then call that function 3 times, and > let it do its job each of these 3 times. Then you'd still be able to > reuse most of the code that already exists, by following the same > convention: either scroll-up/down or set vscroll. So that=E2=80=99s conceptually equivalent of inserting normal redisplays = in between set-window-start and set-window-vscroll, right? >=20 >>> Indeed, that's not what we want. Which is why scroll commands are = not >>> the right starting point for what you want to do. >>=20 >> Maybe I should state what I want to do clearly: I want to achieve the = smooth scrolling when both scrolling and moving point, i.e., both = scroll-up/down and next/previous-line, that ensures I never have = annoying jumpy images. >=20 > Once again: scroll-up/down normally scroll by whole window, or by its > large fraction. It is not a good idea to mix that with pixel-wise > scrolling of images. AFAICT mouse wheel scrolling uses scroll-up/down, so a smooth scrolling = behavior for scroll-up/down is not unreasonable. >=20 >> With my limited knowledge, setting window-start (aka scroll) and = setting vscroll in the same time is the only way to to get what I want. = But it is against the design of the display engine. Is there anyway out = of this? >=20 > Not without rewriting significant parts of the display code. Forcing > window-start and setting vscroll conceptually contradict each other, > so your interpretation of avoiding the contradiction by doing one and > then the other is bound to cause problems in other use cases. I=E2=80=99d love to know more about this part. For me, window-start and = vscroll seem to be unrelated: changing vscroll doesn=E2=80=99t really = affect window-start. Couldn=E2=80=99t the redisplay do something like = =E2=80=9Cmove window to start at window-start then scroll down vscroll = pixels=E2=80=9D? >=20 > That is why I suggest to stick to the code in simple.el as much as > possible: it is well tested and works, AFAIU you need to change it > very little to be able to scroll images that are smaller than the > window height -- that test is in a small number of places and can be > replaced by something else. >=20 next-line and friends only vscroll when scroll-conservatively=3D0 and = ARG=3D1, which allows it to get away from the problem I face = (set-window-start and set-window-vscroll in the same time). I either = implements smooth scrolling to only work when ARG=3D1 or I need to set = both value at the same time. Yuan