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.help Subject: Re: Correct way to implement `pixel-point-and-height-at-unseen-line'? Date: Tue, 14 Dec 2021 15:30:44 +0200 Message-ID: <83bl1jl3ej.fsf@gnu.org> References: <87pmq1wag9.fsf.ref@yahoo.com> <87pmq1wag9.fsf@yahoo.com> <838rwomv73.fsf@gnu.org> <87czm0uifx.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29938"; 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 Tue Dec 14 14:43:49 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 1mx85t-0007Xt-HK for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 14 Dec 2021 14:43:49 +0100 Original-Received: from localhost ([::1]:48730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mx85s-0007K6-AA for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 14 Dec 2021 08:43:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mx7tI-00086Q-1M for help-gnu-emacs@gnu.org; Tue, 14 Dec 2021 08:30:48 -0500 Original-Received: from [2001:470:142:3::e] (port=38532 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 1mx7tH-0003IY-37 for help-gnu-emacs@gnu.org; Tue, 14 Dec 2021 08:30:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+2Yadz/lAT9LNw5jz1CKKHZNziWsOGnA/107b+Mk7YA=; b=AFpzfz0fy/Oi RRuXDmwXsbMdSjTa1cMAHqAK1HkPeB/24Rdar9VVCFOEqAcVzhAlhGci39snLWFQPag9iIP8wp1cw EWt6r4MFP7FUXZNTfcdX81Y3Vh3OyuS1H98/C52GMICfyJoc8XNKcI+k/TnaVKMq8rDVLSiy2Lne+ G2HfWy7VI47zYhI8JZU2RScYkOur07X4pSE3anQcvbSxge3LQYsWVLexV/y7dyFIF+XBrEFXoqAmr 4MNDAG6Fj+UxMInrDeW3M2xWGP3duDk0FgfV/pSCWhItlBUi2+GB4xoCU+9K9lFocdvS4/x3DZq71 urAXXHWLIB2dJRf9/74lSQ==; Original-Received: from [87.69.77.57] (port=1666 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 1mx7tG-00042k-SU for help-gnu-emacs@gnu.org; Tue, 14 Dec 2021 08:30:47 -0500 In-Reply-To: <87czm0uifx.fsf@yahoo.com> (message from Po Lu on Tue, 14 Dec 2021 08:41:06 +0800) 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:134973 Archived-At: > From: Po Lu > Cc: help-gnu-emacs@gnu.org > Date: Tue, 14 Dec 2021 08:41:06 +0800 > > Eli Zaretskii writes: > > > And you didn't describe why do you need > > pixel-point-and-height-at-unseen-line's data in the first place, so > > maybe there's a different solution to whatever you are trying to do > > that doesn't involve such a function. > > It's used to find a suitable new start position that's N pixels above > window start, so vscroll can then be set to compensate for the > difference. Did you try something like this: (save-excursion (goto-char (window-start)) (vertical-motion (- (ceiling N (frame-char-height)))) (point)) where N is your number of pixels?