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: Thu, 22 Oct 2020 00:16:04 -0400 Message-ID: <183EE2A7-4FF5-4888-A6F5-BDE08BD5F482@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> <1B858755-4CAE-4E06-B867-098B323EF79E@gmail.com> <83h7qnmtq4.fsf@gnu.org> <8C545387-7A95-4B4E-A71E-05949E8A4641@gmail.com> 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="3474"; 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 Thu Oct 22 06:16:45 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 1kVS1t-0000q3-Co for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Oct 2020 06:16:45 +0200 Original-Received: from localhost ([::1]:59954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVS1s-0002SA-Ez for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Oct 2020 00:16:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVS1K-0002RF-B9 for help-gnu-emacs@gnu.org; Thu, 22 Oct 2020 00:16:10 -0400 Original-Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]:34984) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVS1H-000872-JU; Thu, 22 Oct 2020 00:16:09 -0400 Original-Received: by mail-qt1-x831.google.com with SMTP id c15so212316qtc.2; Wed, 21 Oct 2020 21:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=aQKQwi2UfAmA6jo5mmFhIMbLNbqkaPOgBYEQfQJ3VSM=; b=FAC0J93MMyLVvFG80B7XRbiBsMW0P0sh6KDVw/mNN1i4PQtS+hnaielN3kinPc1LNI OkYimlz7VrkyQbgmFVpc9Cz90fahMTSlZLLvdB5OWk7CEJ2+yma2b5XPoNH49Tr1J/XP CsAHb1QeQWumT85WSXvCX/Mih5/dt7NxAs4UhlB0Mu4NmowIPH7bSXRSg4T5Ro5X2X4+ NjILacn+z9AQNC0YM2lOYOFpU0xZSZUg++ifdF8NRVcJBm1Qb4kYJfEsKfeyrd8kaTeF pjJzHVH7AMulnwr8beN1J4nVmk7lTA4fNJ48d2KCDwwhuO7RBlFYKmA3w9wwJmJ1ZaBl M5QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=aQKQwi2UfAmA6jo5mmFhIMbLNbqkaPOgBYEQfQJ3VSM=; b=FpdyP5fSe9q2Qo7vOOjQuu5VPg5Mh9iYgVGJ5GA4KVSWO4J3niyygjP4mNmQxKiphp BibyuF8v4mEvy97JLjMfrd8FcGrD2W8A35CWOFLFz3vIhXQWx3QFef74OQ86WJV9yP6U sK2pNKp23Xl7I91/YIOXl4iyqVsSdzz3EOf4lf1DxSxMNu3YuJlBwdqZ8yRAElHSqdd0 CjRj6xU/ZWWhzZCOrcMAHnEOU4FWEQb1e/s9T0D+sFRbKf0BYX6hfo75obQzN8XqcC0j ewKjMpXeJNpbdecmTCT5j12ggGfvK7M/mg7AY4MvuRQAqJaQxLUOU9kyB2pt5veNGsxF ev8Q== X-Gm-Message-State: AOAM532ZHF9/7jWZkZQBIncp+eMQ1ZvIPciVrcWh48AliQNuPsjZSaeE pKUHretNvq+NWyU6r16LiULckl6fCOaCx0Yn X-Google-Smtp-Source: ABdhPJyOWiYvQbYmw/pk9/LHgYDY/bLMevMdrfYMx1axlTNza8Qjn0oRx8XAZtJbyTr3nXOdgz1sMQ== X-Received: by 2002:ac8:74d:: with SMTP id k13mr362433qth.191.1603340165870; Wed, 21 Oct 2020 21:16:05 -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 d14sm401261qtr.62.2020.10.21.21.16.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2020 21:16:05 -0700 (PDT) In-Reply-To: <8C545387-7A95-4B4E-A71E-05949E8A4641@gmail.com> 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, HTML_MESSAGE=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-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:124632 Archived-At: >=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 >>>=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. >>=20 >> I don't understand why you say this. First, C-n works on tall images >> with arguments greater than 1. And second, I still don't understand >> why you need to set window-start, because vscroll should be enough = for >> your needs, as far as I understand. >=20 > C-n doesn=E2=80=99t smooth scroll on tall images when ARG > 1: The = code checks for ARG =3D 1, if not, it doesn=E2=80=99t do = line-move-partial. I also tried C-2 C-n, no smooth scrolling. >=20 > I thought vscroll is a relative measure and is measured against = window-start. And it kind of makes sense to set a window start as the = basis and set vscroll based on that. So I kind of assumed that = window-start is always at least partially visible and vscroll is always = less than the height of the first line. Now, if I throw away = window-start and scrolls entirely by vscroll, will there be any = problems? Like, does anyone relies on window-start being visible? I felt = like that=E2=80=99s what people uses to get the first line displayed in = the window. >=20 Ok, I looked at redisplay_window, and it zeros out vscroll if = force_start is true, that explains my initial question. After reading = the function, it seems that setting window-start is the primary way to = scroll and to produce the glyph matrix to display. IIUC this is how = window-start and vscroll works together in window redisplay: we have a = window-start -> try window -> start_display on window-start -> = it_initialize on window-start -> it->current-y adjusted according to = vscroll -> back to try window -> while (it.current_y < = it.last_visible_y): produce glyph rows. This doesn=E2=80=99t seem to be = too contradictory, and scrolling by setting window-start and add = sub-line adjustment with vscroll seems to be complaint with the = redisplay logic. What am I missing? Yuan