From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: move_it_vertically_backward question Date: Wed, 15 Dec 2021 21:38:14 +0800 Message-ID: <87h7bang3d.fsf@yahoo.com> References: <87lf0pw78r.fsf.ref@yahoo.com> <87lf0pw78r.fsf@yahoo.com> <837dc8mue3.fsf@gnu.org> <874k7cuhv4.fsf@yahoo.com> <83lf0nl56t.fsf@gnu.org> <875yrrtiwj.fsf@yahoo.com> <837dc7l2pa.fsf@gnu.org> <87ilvqty24.fsf@yahoo.com> <8335muj8zk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19416"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 15 14:58:03 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mxUnC-0004pI-DJ for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 14:58:02 +0100 Original-Received: from localhost ([::1]:32818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxUnB-00048l-A4 for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 08:58:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxUUN-0004Cm-Jx for emacs-devel@gnu.org; Wed, 15 Dec 2021 08:38:35 -0500 Original-Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]:39729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxUUJ-0008Fj-MX for emacs-devel@gnu.org; Wed, 15 Dec 2021 08:38:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639575506; bh=d3qjnElmqvqLtEuuxZ1EGSwwto709RJVrFAfQMMjs+Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=fZlb3y6FWGqTJTIeKCNPX/WMqDAJf700BAK+0OBoiWsU+5GLREHDdOczKOmBIpIyNQEdkspIsyx8pNPNbtpszO2VTfoUmEaS7roUYq37nD74lpxwntjPOjflKsVlw/TWYCrMlVELtq6NL4RyuqRMCL6rqkbI/G77A/1wghO4NVRGofBcqBUJnJUxNuHHKWU69lWYCdVquul+6qAC1xrC4S1s9zDf0XVXc5pj7X+gi9KnEPC5eWldQO3eV5wqN/MZEirXmk7egnpCLtvSksyj/TqGLYS2R6KmQ3ltC68Y1jPT0CY5rw4PiPQFCsU6AyvZAqGAeo/JZ9e9kNZUBiMXLA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639575506; bh=NspoleqFaqiRTURowR+hydjP1tS9S4/RZbtONI9V7dB=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=pdgKr/5ohl2e2fmSNKvxPoK9bUI+07JixTyf5m6jUGREOY/Qg9ifiqNUoU9jMT79oDhm5Ma5/RicAAGpRDvayKXwk7avr4j4VfsC/hQiTd0/rEL9R2V38jr+sFsKrcmy+y+bNBZ7Mapeace27A3hNCfIqOVr12ALBbOYKbQWFfF2JbO7ZUSXS34ZI2jlTXNpzQ4/GYqH/34b8RJp7WpyBSQYfKxibuSyxjk8+uZAhx1sZHHq4IXBd4DwJ82ZfxfyvVffJg/nr4An2TaYcwNoMpNdWfFqFso9qsDgNdySdtw83jOa54bVx90hloenogEtcPbfqfwno5AaMRnygAJdUQ== X-YMail-OSG: RzdCMcMVM1nKrHbexyIwAoiUUOSpEwadYlEO1dD8TieGgyDsAbkSAwFyM2BFZ29 NooVcK3xExwco6RzKH1bex0RqPf36UctNurKNi5dnvAYC8YJqxyuW4j_MD6ue0wrV3rpyQ2_r2bZ RSxiA30raJTa64ToAcX3etz6JvStpAFjxoZVZ4s0Tyh5weaMCs7MEX04hlUK7dfTjjJbJaB8aZUF pGRMwHR9qlY4zg7PVYwyHguuW3QRf2EsuTzirQIaxJv1sjR6QTnDC887dyKQwMHTAcW2S7ITMN.x pFoFy4xxWT6QOAqi5II5ZDvbw8QF.PfjdpGbv7NpCUXM84KejbBkTPNkzG0owR.Z5Fy4ziiutQz3 IvZR7gMFIi2fs2ZlCaBP1Rdxxb5DAPQi8wkGHHmMgAQwdVTt9_KKKSj2S53P.Z68lrWwOeI45_RZ PcGlMtJaNpCxoi.JaCj9Yp51ic0WJfk5zSllqRFF999cXVA7itpKGOMIhFHLCOFqG5n4OLquN9LY BxqDfZa2B9RQAsG5UynicIQKh8iLrFHLt4cN.HEllN2AfyichulMzOyPFjQVDiU7BmjKBOXCFJyi 7kayaj5CmqDzgadfUpRJpJyv1jaojBKRR0CM3D25zIms9k1OYYxuN9nw883NkGWQHdFmfjN6LIis IMwgOGtF3R2hUXh6lPitAJOLfYGlU4euL_bQZilyYPbggJutCuwBve_TIrp0ftN_FP9IQ17POaE6 30lfM_FQU3dDZc_uiPxKcrK0NNj.28UVJcAsJ4JaA5N46IPsnw8zbLNWGFIE1z.oW2Flw0vmvH9T lmq7i9dXiPTOO5nYfOdKHhhHYyxp23tM3fc7Pf7rU3 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Wed, 15 Dec 2021 13:38:26 +0000 Original-Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 665c5ae1e9333918b85cccbe29c601f6; Wed, 15 Dec 2021 13:38:20 +0000 (UTC) In-Reply-To: <8335muj8zk.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 15 Dec 2021 15:25:19 +0200") X-Mailer: WebService/1.1.19415 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.190.31; envelope-from=luangruo@yahoo.com; helo=sonic307-56.consmr.mail.ne1.yahoo.com 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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:282037 Archived-At: Eli Zaretskii writes: >> I still don't believe that would be better than a separate primitive >> (since it doesn't make sense to supply the width information to the >> pixel scrolling code), and unfortunately I don't quite understand how >> `window_text_pixel_size' works either: > So you don't have a sufficient understanding of how > window_text_pixel_size works, but you are already sure it isn't a good > candidate for the job you'd like to do? Maybe it's better to wait > until your understanding is sufficient, before making up your mind > about that? No, I meant "don't quite understand" as in the two questions I asked you, which you've answered below: > Do you understand why we use SAVE_IT and RESTORE_IT in the display > engine? (There's a comment near their definition which explains the > basic reasons.) If you do, I don't really see how such a question > could pop up. Maybe the comment that explains the need for this gork > should be improved or clarified? I didn't understand the comment when I first saw it, but now I do, so I retract my question. Thanks. > See above: we don't lose anything in such situations. I would not > have allowed code into the display engine that would break bidi > support. >> Yes. Maybe calling `move_it_vertically_backward' itself until a >> suitable position is reached will be better, as I really don't want to >> reinvent "move_it_vertically_backwards but slightly different". >> >> Something like this: >> >> move_it_vertically_backward (&it, pix); >> >> while (-it.current_y < pix) >> { >> last_y = it.current_y; >> move_it_vertically_backward (&it, pix + it.current_y); >> >> if (it.current_y == last_y) >> break; >> } > I cannot say anything intelligent because I don't think I understand > the requirements well enough. AFAICT, you never described them in > enough detail, neither on help-gnu-emacs nor here. The requirement is basically to find the start of a line that is at least above window start by a given number of pixels, and to also find the vertical distance between the top of that line and the start of the window. For instance, if we're scrolling upwards (upwards in this context is opposite to the terminology we use for line-based scrolling: it means moving the display downwards, like scroll-down) by 17 pixels, and there are two lines each 14 pixels in height above window start, the new window start will be set to the start position of the second line above window start (which this function should return), and vscroll will be set to 7 (which is 24 - 17, where the 24 is the aformentioned vertical distance that this function should also return). Thanks.