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: Sun, 18 Oct 2020 13:51:14 -0400 Message-ID: <66013ADF-731C-4922-8AF7-EAFDBF43C33C@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> 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="17747"; 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 Sun Oct 18 19:51:46 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 1kUCqQ-0004WS-Bh for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 19:51:46 +0200 Original-Received: from localhost ([::1]:42396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUCqP-0006tk-EX for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 13:51:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUCq1-0006r9-I2 for help-gnu-emacs@gnu.org; Sun, 18 Oct 2020 13:51:21 -0400 Original-Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]:45313) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUCpx-00004x-VA; Sun, 18 Oct 2020 13:51:20 -0400 Original-Received: by mail-il1-x129.google.com with SMTP id t18so8110672ilo.12; Sun, 18 Oct 2020 10:51:16 -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=9vHyGIYWcSLKcK6OiqzHFNaknFycVzrKtv/BVZEm49g=; b=ffHlrVSmfO3swp0zQZxEPmpQ0pMde7XkvWYr1DFOVDV8MT3MR5uAZJceY0tVdX7TQu lQSrCIzEO7xuqUIVyQu+N3KeItXysaDYuFerE0uL/3Svb0dvwSu7LTd15dT4o+GJUtKy AoBP0D/aYahthv5ZTkQlchlnnPCMLSUBVgiJGA6RWjWJ4Qs22VixvhrDbVeEf8w0SibP kn2ulgOyXxlxn6s2RnEF05L+aVP7XlNTAO+XhDlW5sC5foA7doGIf+wrTXtVsWv0WD0i EIDKibhQZ+rL7R0vFNtSJ/rorV90IJDHuwUQqAyQWFfb0t7qqsWiD/br+rJFwfo/SgGv Ediw== 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=9vHyGIYWcSLKcK6OiqzHFNaknFycVzrKtv/BVZEm49g=; b=mxxNh43XZ9Cu0nje/zrtYTpH/87dSprdSFW4BLcvu9nMr1l23zLvJT30hNyXyUEgv1 1A8Zj69pe3CQmyeAHHRdZGwkYeCLe7XunRkqA0FwAMzIQWCWwJoEfFCv4TMu9DEG+M57 qnuoE0YdfzJwCcQQAxMgppcPwTjCWWhFFKGae9KUt1X/yxcXTxnnMpkVgve4RanwwhPl irSSfzD9d+sTgOQOEAAXW3rYpa35UrYce6cSlmgzgt/f7lN9fki8KO0WvbobN5VVfpLl t6KQQ7Zj4ZQqjX+N/u/1Q21lln258gqoMLj0pR1SY0LqWsYD5B1BLO+KvQTG5MtOIZ4c 927Q== X-Gm-Message-State: AOAM533PGUdZ9GK21CIdYH+fWE4iIMdU7DR+UZf1kAuewWeDFSNWksq9 TTsdlZ0vzKa7aNDRWY8C8sIeShbrnQqSzPvO X-Google-Smtp-Source: ABdhPJx63aJY5dSi3hzVlxi58zYGR1bm2fuH1GgLQ9X6FLOmM26OMf/uwkOZM95zQNlXOdXHIZUROQ== X-Received: by 2002:a05:6e02:507:: with SMTP id d7mr8119882ils.67.1603043475878; Sun, 18 Oct 2020 10:51:15 -0700 (PDT) Original-Received: from ?IPv6:2601:98a:4200:9210:d02a:1c66:2033:eacb? ([2601:98a:4200:9210:d02a:1c66:2033:eacb]) by smtp.gmail.com with ESMTPSA id 18sm7785457ilg.3.2020.10.18.10.51.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2020 10:51:15 -0700 (PDT) In-Reply-To: <83imb7qw46.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) Received-SPF: pass client-ip=2607:f8b0:4864:20::129; envelope-from=casouri@gmail.com; helo=mail-il1-x129.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:124547 Archived-At: > On Oct 18, 2020, at 1:31 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Sun, 18 Oct 2020 13:24:25 -0400 >> Cc: help-gnu-emacs@gnu.org >>=20 >> No. The problem is in your code. First, you use set-window-start = and >> scroll-down, both of which tramp window-vscroll (as you probably >> realize if you think about what those do). =20 >>=20 >> Why is so? Is there any material that I can read about these? >=20 > These two functions force Emacs to display the buffer starting at a > particular position, so vscroll is zeroed out. Otherwise, how could > Emacs obey the forced start point? >=20 >> This works, but brings flickers: the image first shows completely = then the vscroll takes effect, which is >> reasonable but not preferred. >=20 > It was just an example to explain to you what should be done. E.g., > when you scroll a tall image with C-n there's no flickering. You just > cannot mix vscroll with other code that affects the window display, > that's all. >=20 >> I found that using (set-window-start nil (point) t) with the third = argument non-nil >> gives me the desired effect. My guess is that, as the doctoring said, = setting that to non-nil prevents redisplay >> to try to make point completely visible, so redisplay doesn=E2=80=99t = modify vscroll, so my vscroll value survived. Is >> that right? >=20 > 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? Yuan