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: Correct way to implement `pixel-point-and-height-at-unseen-line'? Date: Mon, 13 Dec 2021 09:38:30 +0800 Message-ID: <87pmq1wag9.fsf@yahoo.com> References: <87pmq1wag9.fsf.ref@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12417"; 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 Mon Dec 13 02:40:36 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 1mwaKS-00031X-IO for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 13 Dec 2021 02:40:36 +0100 Original-Received: from localhost ([::1]:37198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwaKR-0003uk-BF for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Dec 2021 20:40:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwaIf-0003ub-8a for help-gnu-emacs@gnu.org; Sun, 12 Dec 2021 20:38:46 -0500 Original-Received: from sonic308-10.consmr.mail.ne1.yahoo.com ([66.163.187.33]:38208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwaId-0003kb-6D for help-gnu-emacs@gnu.org; Sun, 12 Dec 2021 20:38:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639359515; bh=cP8hviNIY5nj8EFmaMSIcva7OmDaSAfeRIOzVWC10Nk=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=qCY2BGEfMIBadW3WJ+p1d9RcrpspE4fCvRkra3WHGrijYURDgyWur1CN1YTyP7modzjYpLgSeh83f9mkijMY9kyOO+BUU5U3ugvks2jCrco3/9tI8C1HuaYGIlTMgHslJyIJZ/6c8+GUzxwgSw2JxSeOSw/XMW1V0P8BrctrDf5QussHs/4fznyxpdoWQ1OPgEI5PRhiSNy1NGnTz9pZl0XQ7aUariyu+JAWtupHKezgsoXdzX/BGPGHybiglb+SQe8IYVfL9JDpFU9QEuuUZ29WpM0QPM7aZnfFyJyzDlG8bizjavnxKjOfQDHR0i70OiUqAR/YrT1eAzE/pNQLQg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639359515; bh=q5nyTb/Rkzk/eFt0TCxaKJg1HQKtBe4h++8ark4afmq=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=qjmhYemB2SZMYkWrHV0qPBIJblSjqAX7IopNVx/Xg7f+1Wqb9ZnppXrJZTTIzIJ0XWEGrboNf9qd+8YYPLaRMhz3FPWVSpNPdeugGOnwSzKCTw1l2+imknOoyk48oBgIpwYGrZFwuUn3GkMVoXGII1X8WIRwj8Ri9Ydb5mame4r3pVs22mGhI5gmLfkaU8NydIplm1wiRs0QSr7DSiVFXZi4rvBi7FuoOfTWv+788XMcsMdfLb2BKpinwxm1/rcYuNSzACfTZisxg0MD4+rdRHgryuAQ6oeAZN3VAKbizWr815qV8KxIDkQyHoaouz94y7p9zP9YYeLbDR9tBilW2g== X-YMail-OSG: l2gDI4MVM1n_xuk1oj2oHivLB1LQq0eRZAJxFs0lRVUj7NsWLalTMt9R6V58Ie6 Gj5.oaykIKrGqIEVyV1pf8SjBn5t7QTzSjVv_0fI1ssmMaN53JPv_nqHefQWTPwhmoT5iEc0CaSH hAmrcmTkvuELAniZDVulXT5rPq6O0QpSRi.c_3aL1q5nk0GRlrpVof9NJ5B981zu7YbeJ01qfU.S 9_f47KV8QYu1ojfxuat8HJYjBzEsGwzD34mGNZjZ.dTuOfE2WMEXvjCrAPzWvueFLOUbXLQ6G54P 1b0UBCrAA6CMccN8FyhC482vINGFzrGvB5IsnxJPOwVN3hdrlkrts.NMUGmEJNjNlobIyZZGoo5u GoxG67AkKngjQBOBUQ08pCmBkV3XzFk1iyKH5O0Ld4anH7C_pd_2arM7nOMNRiLT2qqIdLSOiqix bBzkE0wC1Kxe9HiOZH7gpEYxYb8sgRTpsvOwoqWQbe6S4.yDXLQvq0Ce5RbT7TmSboamME2nlTJU CCFmYk0I0eodNexg.jzYsf43UvB6.92ZtvSKrRAMhKfNeN9N9_r2TLL_FtTbS5aZB0Iqfnpahnvx cVyXBz.oSN1lKzgtxqWRsQG72tFG5EQtOy0GxQDdHUUUz5bqHJ2PNI7nAO7SYYSG5STcbxQ6Ja7c pJwe40cKPxyiDrmYcKegFaNgp4pSpZEwtC0ykzGPP1iBkL5awHakwV629eMD5u0.Mo1V_k2yCOCm 7BOaH63ZfgyHUNM9_6znOUgxLTQXgn4ZjcrgAjh9QUipb2il4Ll2dVR7ksxBzcl4557xPlthjQCJ lvt5McoFqdt4MV_Nha6eBM36JWisg6M_acqj8XA.EA X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Mon, 13 Dec 2021 01:38:35 +0000 Original-Received: by kubenode507.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID d22f1379876b3fb60e5b0da997017015; Mon, 13 Dec 2021 01:38:35 +0000 (UTC) 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.187.33; envelope-from=luangruo@yahoo.com; helo=sonic308-10.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:134953 Archived-At: 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 in Info buffers, so in order to measure the height of the previous line (or object), I have to find the beginning of the visual line at window start, and pass that as the `to' argument to window-text-pixel-size instead. 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. Thanks in advance.