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.help Subject: Re: Correct way to implement `pixel-point-and-height-at-unseen-line'? Date: Mon, 13 Dec 2021 10:49:53 +0800 Message-ID: <87h7bdw75a.fsf@yahoo.com> References: <87pmq1wag9.fsf.ref@yahoo.com> <87pmq1wag9.fsf@yahoo.com> <87fsqx4557.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11315"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 13 03:50:55 2021 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 1mwbQU-0002my-Q9 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 13 Dec 2021 03:50:54 +0100 Original-Received: from localhost ([::1]:34892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwbQT-0007lX-QG for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Dec 2021 21:50:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwbPo-0007kl-J0 for help-gnu-emacs@gnu.org; Sun, 12 Dec 2021 21:50:12 -0500 Original-Received: from sonic305-22.consmr.mail.ne1.yahoo.com ([66.163.185.148]:43608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwbPh-0003ds-Tn for help-gnu-emacs@gnu.org; Sun, 12 Dec 2021 21:50:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639363804; bh=xX/5WXI0sQgKuTMbHv5Not9uiQIJ2JkUibtFKYss39E=; h=From:To:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=s9bXlqrDfgSvJwk9gXTFrfR+ou3DaR3FcUCLjERYMpwp75dOSAgiT6/HDj2AXaX8qvtFviA8tc8LdcR0V7yCnuWG8GvXtXlIO0PnthqhGvKFWiWlEdqLPp965AurXkR910mrCBl9406AufZ1EsnZSq7xweGcswuOLQCghsmeou0WueHy1m7wiCp33bHg1tnSDFexedjuOAsqwkU2xZoIo2MlOQp45OhBZio/ItjrlMVz+sKXCZA22mP1MgvcbstWsKOshZzm6SAJ7QothDFaa5FQGnqeWH92xa3zuU/ayxhNylkhbmMnUNU8JJJGw5SX1GuDLxFwzw8PDmqZv0GbNg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639363804; bh=v3Asb9jWLBoYdo8GDoJqTODOIcmAKspfYbpOm1WuRlN=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Hc8c5HzkC9+5hkfLHf3VVO2Qlj7e55rJUDr9eUsgGx9H1lv4X4+78SXKzbVwp1yhh4RSoxqa7SQYL4XNVVo1JrnC63ODOcI3e1/YhIpkNndrC5J9zFchyMiMqHXrvwJ5eYp8wKsDjUFSmUJ8ZqY1yO1i6gxg+mwitPDfzQcPU+eoyL9k3Ryaypj4r62DUBNqAEZSGzxp+/heIZ9t8YqnDAsYMtkoKLZibGM+mZlsA7MxGtdREPqr1+UW2DM4VL9875kzDG1BHaSHL5KZ2HvF6dWUJ2noyD4MhTIQ8+xOQxuBKHhiQzhAutdMaLHWYNe3pvPvMTqu6P3PbR0OmYp5nA== X-YMail-OSG: Iapjwk4VM1lq0eluZCT2kqN98WOWFMUkIaNpo9BvDMINv5NBfwi.lOVDVMxQ7oE MMvlDZuQ3f4FTq8clpY47junWQNOZz3OKgimnjl59lLjME_VTrf2TzRfyt4ga7acmP7pV8JNFZvP qjV8pLa4n8KMDqs8dUQpIGItdrG_04tZWKk62Zuq7lykoXLyS9pyfXi0HfzqDVPe_6zEUCHbbpMP qj01YsP.Gu6.iB1jB00c43Js2cIGRmATXqR9Nl_j8yNDfoCKQJW2uTIakZYxN4LMSMPnLwhZot7D sdDGXBvIZesc1iIo2b10FkXGRH7bPfriXNH46nPV5k1R0rG9fZQWtRreA50UMxITps0DduXAvSSe LhQc1IO2540OrBeHZBe3G8f.U65fh_ObBOOqu0bCAmsml5cDqA5gZ920kg_LicpXLWCk9OpB72lZ THuZJF4WqpyRFjzEroGYmKsVLM_33ZMbbxK4bvOhfrg2sXRaP0ZCOqoRNpzrznp6Vn1VXUiXfy5H wfCeJan5C2NpRGeJaQmakKoNd1NjRS947j1aPcsv4Z7bgdYjBYLHROlqbLmEknFeDM8qhNPqXniO rXVjK5Vn9qU6IOwsS1HxtHllS88Dz5SZ76zBZo81hKq3XZTNSCcMq3hfziiWjhpQ5e8XznfE4uDK KTJ3tm7i3KBewyVpRSdOACeKeZoLzg7y31UiDK2RoVOdDCz8jV87ahosJsBar2T.ZaV.vVUl7Y2S hYgy1KqtneLlSq9x0.YfiASgG0WbhDhwKWijdxiTZGwXbPzbBu_ZN9VHbNDNULyX0W6Kx1lUGNUb heIZQApKtV1W3gYgft80ncTqh1usQUZwqPeKS9PoYY X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Mon, 13 Dec 2021 02:50:04 +0000 Original-Received: by kubenode508.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID e0a0b80af3cdab237a47e0a647dc060a; Mon, 13 Dec 2021 02:49:58 +0000 (UTC) In-Reply-To: <87fsqx4557.fsf@zoho.eu> (Emanuel Berg via Users list for the's message of "Mon, 13 Dec 2021 03:20:36 +0100") 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.185.148; envelope-from=luangruo@yahoo.com; helo=sonic305-22.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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:134956 Archived-At: Emanuel Berg via Users list for the GNU Emacs text editor writes: > Po Lu wrote: > >> I don't know how to make >> `pixel-point-and-height-at-unseen-line' work correctly: if >> I use `line-pixel-height', it will only report the height >> the first individual line inside a display string if there >> is one above window start, but if I use >> `window-text-pixel-size', I have to determine the region to >> measure, which is quite troublesome. >> >> For example, window start is often not the beginning of >> a visual line > > `window-start', `beginning-of-visual-line' ... > > You can post the code instead ... that way you don't have to > remove the dashes. > >> This works okay until there is a `line-prefix' property at >> window start: in this case, window start is the beginning of >> a visual line, but it does not display at the beginning of >> the line, which means `window-text-pixel-size' will add the >> height of the current line to that of the previous line. >> I will add a workaround to pixel-scroll.el, but there must >> be a cleaner way to implement this. > > Sounds pretty clean to me but difficult to say since you are > not posting the actual code. It's in pixel-scroll.el inside the lisp folder on master. See `pixel-point-and-height-at-unseen-lie'. Thanks.