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.devel Subject: pixel-point-and-height-at-unseen-line Date: Sat, 27 Nov 2021 08:51:53 +0200 Message-ID: <83h7by146u.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33764"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 27 07:52:27 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 1mqrZS-0008b1-LN for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 07:52:26 +0100 Original-Received: from localhost ([::1]:51372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqrZR-0005Ji-ID for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 01:52:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqrYu-0004W4-OW for emacs-devel@gnu.org; Sat, 27 Nov 2021 01:51:52 -0500 Original-Received: from [2001:470:142:3::e] (port=45816 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqrYr-0006WW-0N; Sat, 27 Nov 2021 01:51:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=b/Gk+7i4jpcyFiFbOwtBwUcvd8MhDUjmJ0jbUBo0BPI=; b=lHeChU96FGuV02 eZBYKacJAqXDuFOV7OcrKKYi17QnDnPZdDRe6E2upmtNA1SX6JmkdimFLJcdZtL8uEbZcHq03wXhI T2FONDJ7f1PtMoxsFaupsDgW+kHSSImeJgbfrhzYI6I8B3IYGT4qfqM/zGfuIA5sEPzgrHT+ny81z 9xiJEk5IL+gQp+gISYX22rT8ZJfC8ckVFFbG8ezRUWESZ+Ui1ZH4P6j1CDvy4jn1uKdfUufhPOpa8 OK7HxRM538//3x/ovU8RS2T8Zd5z1ZCYYGTTnbE0xcRFxV6DLg0BMaYDKpyyQxT7R7psaa4F8n8dw wMasquf3ZCHrCrGN53Wg==; Original-Received: from [87.69.77.57] (port=1795 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqrYp-0001gr-In; Sat, 27 Nov 2021 01:51:48 -0500 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:280295 Archived-At: This function has several problems that IMO would be good to clean up: . It's unnecessarily restricted to a very special use case: a single screen line above the one where window-start is. It could be much more useful (and be moved to subr.el or simple.el) if it could at least accept an argument to control on which line or position to report. . It changes important state variables without protecting itself from errors and non-local exits, so a C-g at an opportune time will disrupt the buffer/window state. . It calls vertical-motion without checking its return value, which could tell you whether it actually moved at all, and where. (One bonus of checking the return value is that you could perhaps drop the bobp test there.) vertical-motion can do some surprising things around overlays and display properties, especially ones that include newlines in their strings. Thanks.