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: Wed, 21 Oct 2020 15:05:26 -0400 Message-ID: <8C545387-7A95-4B4E-A71E-05949E8A4641@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> 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="16284"; 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 Wed Oct 21 21:06:23 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 1kVJRH-00047a-Ak for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 21 Oct 2020 21:06:23 +0200 Original-Received: from localhost ([::1]:37664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVJRG-0004eP-D5 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 21 Oct 2020 15:06:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVJQU-0004dV-Pb for help-gnu-emacs@gnu.org; Wed, 21 Oct 2020 15:05:36 -0400 Original-Received: from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d]:36534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVJQQ-0001C1-UX; Wed, 21 Oct 2020 15:05:34 -0400 Original-Received: by mail-qv1-xf2d.google.com with SMTP id ev17so1694625qvb.3; Wed, 21 Oct 2020 12:05:29 -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=ZSjDlNGdeE0LlcDg6vW1skt4jej5jduJnv9sPbEhfec=; b=SD+XVME4g28zrv7zr8ufq4Bj1fCuf1SCM7LWggAJKVlscCyEAhxZpH14Na87LIibkh UlxnTtNpl4iP2jZglzvMmj/MpAjIoHTyztv3FJ84fVM36eO2rZY4c8Y7bJwVgQ7dicVJ dV3JvA9qX1R/1xsrV+nAcXERo3oDcLeODErKqlspTQBNFJCA7ZJEUXOnu06RyBNgFb3+ BpW6+lHjUrt88iZSjhCFQQNfdQh5sS808B8R7JUGbm8CKe3MaS1BBOf63GwctpeRaFW2 f477XpjSc4oSXE8VONJmWejzO2oyowyXxKfafQ0y7sgeBrmU0y5i5phnWD8fyEoo15gh pDNQ== 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=ZSjDlNGdeE0LlcDg6vW1skt4jej5jduJnv9sPbEhfec=; b=e89opeu5z9CzJeE3FWdJRzClJUIx8N3+6Q77NaMqy1L7/92HXC7hd5IyPFrLdzLfj0 xJvJzjK+6nMFkX/JFdA2D31Cj2uvTIO/M+JBzFIqTTNPbp7REr6FP+Kd/qGjUYqJGTeA llB/FcZE7wxi/7R49kWrcRw0CiWBFkCC7ciTFIqfBMJHfvynsBrpjj/gezwOhMSz4rh7 ydmy5b/XpHIJShDjPbqYM2mG7c8xW7ZmcvD5WIQIdPPkCGi60l1qZKoPoT0GBhGEFSUi CtZNbV7OTJwv2b2pCIFor3AueshFyAqwoAcn6s5oe3/0w+neeOaCFL3BGtAHGeEluLWv 6g7A== X-Gm-Message-State: AOAM531xIaVeCxF7jY/1lmg8pJjlFKVzfHNB7dQiseRGqmnXMzxG5tlI AyRGxXlq3aigDmOxXM0gTI5yQGPkG2SPzClz X-Google-Smtp-Source: ABdhPJzmg4W3vY64u8+iV+R8DD5JIO34LUzGYQR4h34L5++1tMagD6+xUgi43Ng9442HZcjQvWBTuA== X-Received: by 2002:ad4:5807:: with SMTP id dd7mr4308928qvb.35.1603307128565; Wed, 21 Oct 2020 12:05:28 -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 r11sm1711853qtw.47.2020.10.21.12.05.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2020 12:05:27 -0700 (PDT) In-Reply-To: <83h7qnmtq4.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2d; envelope-from=casouri@gmail.com; helo=mail-qv1-xf2d.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:124626 Archived-At: >=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. >>=20 >> AFAICT mouse wheel scrolling uses scroll-up/down, so a smooth = scrolling behavior for scroll-up/down is not unreasonable. >=20 > Mouse-wheel scrolling doesn't set window-start, it sets vscroll > instead. So you indeed can use that paradigm as well, as long as you > make sure the argument to scroll-up/down is a small number. >=20 > But my point was that you shouldn't set window-start if you need to > use a non-zero vscroll. It does: mwheel-scroll calls scroll-down/up, which calls = window_scroll_pixel_based, which sets w->start (and it sets vscroll for = tall image). >=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. >>=20 >> 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 > The idea behind the current design is that if you set window-start, > you want to see the stuff at that position in its entirety. Having > non-zero vscroll would prevent that, because some of the tall image is > not visible. >=20 > It is, of course, possible to use some other concept, but the current > concept is assumed in several places, and you will have to change them > all. >=20 I see. >>> 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. 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. 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. Yuan