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: Mon, 19 Oct 2020 12:56:38 -0400 Message-ID: <4F794407-585E-4C74-85F3-00A668FB9675@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> 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="9365"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 19 18:58:41 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 1kUYUZ-0002Ii-S0 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 18:58:39 +0200 Original-Received: from localhost ([::1]:53838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUYUY-0004Py-Ua for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 12:58:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUYSh-00035D-Rx for help-gnu-emacs@gnu.org; Mon, 19 Oct 2020 12:56:43 -0400 Original-Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]:38019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUYSg-0000Nl-6T; Mon, 19 Oct 2020 12:56:43 -0400 Original-Received: by mail-io1-xd2a.google.com with SMTP id y20so452377iod.5; Mon, 19 Oct 2020 09:56:41 -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=PXtcEdCc1e/yGJMnyePBTQ/4O4NVamWhCRwIyeyyljs=; b=jimM6FYu4qO7MUQVXvHv7+OOipWyV2GUE/WLCQ0U4wUNRJpBY1uH92A3m16diJhlfh fGEWTmvwZSl0vzA1KQOSXZPk/+CQuffViRJOLH+SSgujIQMQVk4/O2sECogPzoxhXb1X 96LLBK+4+7KtxqM7FTy97MZ2M93OAHAA8xPuQ6fqKYNLsJqQjGg4V1nw1kFQXo9Kwg// O1BidZl1AH9fSCVPIFLZLbVj5PXXqOnEeH0KM7W6MODmxW/HacuzKp4MiHy95iPSSDob bf1m/ceZGfOEp7tPVZ2d+SDaCaaU6sx0YnjaTRapXhehmsfsVzPpUqJ4JXp2mH3SNu6c K4vg== 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=PXtcEdCc1e/yGJMnyePBTQ/4O4NVamWhCRwIyeyyljs=; b=aeWIU9ITKrBPUsVOETMdVDwyYlLq7d+PFfJY1EtBvqxDnB/p2cPH69WG81r4V61Kyr LeO7n5plcoJfxeBCyhKd2pRYus756DSE97WZTDO976Wc9aAPE3am+fbmNKTz/HjJ6uPq NGron7B/n9nTosA7WZoWtI4AwzL432Vt0jhJ5aXv1aG+QxCJS6VnPKoTqXhfUp0V5Wv3 upV7PFBwM/cgk+aokJzD3S9y8GObDFM7S1R14yigxDywP0tLA7QTPSx6Bw/zOxowUrzc 4vvqJSZXM252uBfCpT/ado2lLanIgYj4a/9hQOg1+eBFmVB/Hlxtx99XaVuzWSvoD8/8 yKiA== X-Gm-Message-State: AOAM533qyV25JMLAIkxmUqCoe/s7FkXODD99eOkD0SQYA6wobDxlrEcy 4dkumy8UCtlg3cU06XUBMfYX9Jc9XowFCl6O X-Google-Smtp-Source: ABdhPJywRDa3I3dlMyzNpA3jF4z9MYf7YppDeH0BJuSIVEM6R53ZjUvWpRTLj/YMgBOZlvwTEpESGg== X-Received: by 2002:a02:a587:: with SMTP id b7mr773147jam.96.1603126600206; Mon, 19 Oct 2020 09:56:40 -0700 (PDT) Original-Received: from ?IPv6:2601:98a:4200:9210:c4f5:d5cd:a594:cb11? ([2601:98a:4200:9210:c4f5:d5cd:a594:cb11]) by smtp.gmail.com with ESMTPSA id o72sm283558ilb.6.2020.10.19.09.56.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2020 09:56:39 -0700 (PDT) In-Reply-To: <83blgyp4k2.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) Received-SPF: pass client-ip=2607:f8b0:4864:20::d2a; envelope-from=casouri@gmail.com; helo=mail-io1-xd2a.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:124583 Archived-At: > On Oct 19, 2020, at 12:24 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Mon, 19 Oct 2020 00:59:33 -0400 >> Cc: help-gnu-emacs@gnu.org >>=20 >>>> Cool. I=E2=80=99m thinking about wrapping move_it_by_lines in = window_scroll_pixel_based with a version that regards images (and tall = lines) as several lines. Do you see some potential problems with that? >>>=20 >>> What is the problem with the existing code that you are trying to >>> solve? Whatever it is, it is highly likely that the solution = already >>> exists, and no new code is needed. >>=20 >> The problem I have is that when I scroll over images they jumps in = and out of the window: (bad-scrolling.mp4) >=20 > AFAICT, you are trying to scroll an image that is smaller than the > window? That's not supported by the current code, you will need to > modify the criteria for entering the vscroll mode there. >=20 > But in any case, I don't see how move_it_by_lines can have anything to > do with this: whatever you do, an image must always remain a single > "display element", and the only way we currently have to scroll > partial images is via vscroll. Which works, so I don't understand why > you need any changes in window_scroll_pixel_based. >=20 What I came up with is this: For (scroll-up 1): 1. If the first row is a normal line (i.e., with normal height), scroll = up normally by one display line. 2. If the first row is an image, adjust vscroll +=3D = frame-default-pixel-line-height 3. If the first row is an image and we have scrolled to the bottom of = the image, i.e., vscroll =3D image-height, scroll up one display line = and set vscroll to 0. In other words, sometimes we are not really scrolling, but faking a = scroll by adjusting vscroll. IIUC window_scroll_pixel_based moves it by = move_it_by_lines and set window-start to it. That=E2=80=99s not what we = want when we want to fake scroll by adjusting vscroll: in that case we = don=E2=80=99t want to change window-start. Some questions: 1. Is there a way to get the line-height that an it is on?=20 2. Where is the code that ensures point is always fully visible? When I = move point around Emacs adjusts scrolling to keep the point fully = visible, but I don=E2=80=99t know who=E2=80=99s doing that work. Yuan