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 16:26:01 +0200 Message-ID: <835yrrl0ue.fsf@gnu.org> References: <87pmq1wag9.fsf.ref@yahoo.com> <87pmq1wag9.fsf@yahoo.com> <838rwomv73.fsf@gnu.org> <87czm0uifx.fsf@yahoo.com> <83bl1jl3ej.fsf@gnu.org> <871r2fthzg.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17955"; 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 15:27:21 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 1mx8m1-0004UG-Gf for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 14 Dec 2021 15:27:21 +0100 Original-Received: from localhost ([::1]:49950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mx8m0-0006H3-Bn for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 14 Dec 2021 09:27:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mx8km-0006Ep-7n for help-gnu-emacs@gnu.org; Tue, 14 Dec 2021 09:26:04 -0500 Original-Received: from [2001:470:142:3::e] (port=40622 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 1mx8kl-0004Xc-W1 for help-gnu-emacs@gnu.org; Tue, 14 Dec 2021 09:26:04 -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=lKOmnEsyw0ZxORe9OCgMIkf+Fds5own29IQJxKEp9/4=; b=Vi1jBik9ZyEC 7AhPFu8qHzJ5o9QxJ8TA+px4Swwn6MiDKQhpoi9GDOpdiHQVMqK8B8BWvCRjK5edNuFJQEtfdcZGt +NS+8wWQptUTbT81hUAApEqP44JjGvchOjMwx/QLNgUukCWUmvHDts41dGQvD3hIgUU8nJMnZzt2o VQiqStdN2mJOv/Hxe1UOw6X3m6v0AwZjGIqpQNhVENfqU3Yfl7eEdAMFoObmU8tMGZLOGMboEJp+O bx9TWsX3dLTOVeNwKG348nWxrh3l2MXf0ZagBoKR47f1tbjcBXLVRDgG03cLxBiwkKnXYTS2mUJqj /c8z92Osbr1wfXG+rleCKg==; Original-Received: from [87.69.77.57] (port=1152 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 1mx8kl-0007pO-R7 for help-gnu-emacs@gnu.org; Tue, 14 Dec 2021 09:26:04 -0500 In-Reply-To: <871r2fthzg.fsf@yahoo.com> (message from Po Lu on Tue, 14 Dec 2021 21:48:35 +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:134976 Archived-At: > From: Po Lu > Cc: help-gnu-emacs@gnu.org > Date: Tue, 14 Dec 2021 21:48:35 +0800 > > Eli Zaretskii writes: > > > 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? > > That won't always work correctly with lines of different height: for > example, if the line above start is smaller than the default character > height of the frame, the number of lines by which to move upwards could > be too small. But if you always need the line before window-start, i.e. use N = 1, then why is that a problem?