From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Set-window-vscroll sometimes doesn't work Date: Sun, 18 Oct 2020 20:55:01 +0300 Message-ID: <83ft6bqv0q.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33230"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 18 19:55:33 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 1kUCu4-0008Y8-ER for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 19:55:32 +0200 Original-Received: from localhost ([::1]:44660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUCu3-0007zK-Gh for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 13:55:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUCtY-0007z5-Cu for help-gnu-emacs@gnu.org; Sun, 18 Oct 2020 13:55:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47256) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUCtW-0000OR-QX for help-gnu-emacs@gnu.org; Sun, 18 Oct 2020 13:54:58 -0400 Original-Received: from [176.228.60.248] (port=4747 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kUCtV-0003MT-4W for help-gnu-emacs@gnu.org; Sun, 18 Oct 2020 13:54:58 -0400 In-Reply-To: <66013ADF-731C-4922-8AF7-EAFDBF43C33C@gmail.com> (message from Yuan Fu on Sun, 18 Oct 2020 13:51:14 -0400) 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:124548 Archived-At: > From: Yuan Fu > Date: Sun, 18 Oct 2020 13:51:14 -0400 > Cc: help-gnu-emacs@gnu.org > > > NOFORCE non-nil means Emacs doesn't have to display the window > > starting at the position if there are valid reasons, so yes. But my > > suggestion is not to use set-window-start when you want to vscroll, > > it's unsafe. You in effect create a conflict for the display engine, > > and have no control on how it will resolve that conflict. > > Thanks. I see what you mean. What I want to do is to scroll over images as if it is made of several lines (like sliced images). Which requires scrolling over logical lines by set-window-start and scrolling over images by set-window-vscroll. Do you think I would be better off implementing this in, say, window_scroll_pixel_based rather than in Lisp? It sounds like you want to do what we already have implemented in next-line and previous-line and their subroutines. Typing C-n on a tall image scrolls the image the number of pixels that is equal to the line height. Maybe you can just use that code?