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: window-height but taking the face into account Date: Mon, 25 Mar 2024 18:57:44 +0200 Message-ID: <86il1ajlkn.fsf@gnu.org> References: <87ttku2sst.fsf@mbork.pl> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35827"; 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 Mar 25 17:58:35 2024 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 1ronec-00097z-G2 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 25 Mar 2024 17:58:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rondt-0003tK-Cv; Mon, 25 Mar 2024 12:57:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ronds-0003sf-6k for help-gnu-emacs@gnu.org; Mon, 25 Mar 2024 12:57:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rondr-0007T7-SC for help-gnu-emacs@gnu.org; Mon, 25 Mar 2024 12:57:47 -0400 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=TMTDQjm0ob7XdmGqgCaMrC93sIRCFnvJzCcmBlkECSE=; b=ahHavB3bK6W+ ZebSL0+5p+Y9VeDPaAL4LD92MibwBVSqdQd+MRGIseBHquaRBemaR1/8AFB6+FX5KGLbUsrd/UU9P /3XC0Lydfund2Pp6bIbtB66XXvOCUbyP1d425dqhpUE55kIhdqvE0zwBvaK8yVXLVEJz9JsTmv1zb DFjjC7od9Tc72UeePfu2dWLZi4xMPIBIz3SYANEYXc/HdcShMrPtEv2Boq+Y6WuaCeXzprCxa9YW5 A8cAY+3peBAR0U9rIjyIB6YiK0SwoBVPBFhzRileUnpTiOGDakHg/4e+7WY1kWb+SE4u2X+SNpj39 pEp8M5zNuVYised2uaeTAw==; In-Reply-To: <87ttku2sst.fsf@mbork.pl> 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146167 Archived-At: > From: mbork@mbork.pl > Date: Mon, 25 Mar 2024 17:13:38 +0100 > > it seems that `window-height' returns the same number irrespective of > the font size I use (set up with `text-scale-adjust'). Yes. Like all the window-dimension functions, it measures in units of canonical character height, which is the height of the frame's default face's font. > Is it possible to get the actual number of lines visible on the > screen? I'd say use line-number-at for the first and the last position in the window, then subtract the first from the last. > I think I could use something like > (floor (window-pixel-height) (window-default-line-height)). This will only be correct if all the lines in the window have the same height.