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: Changing height to fit window Date: Wed, 30 Nov 2022 17:33:58 +0200 Message-ID: <83pmd4jw2h.fsf@gnu.org> References: <83lensljg7.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37891"; 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 Wed Nov 30 16:35:09 2022 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 1p0P76-0009ad-Fi for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 30 Nov 2022 16:35:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0P6d-0003yx-Ez; Wed, 30 Nov 2022 10:34:39 -0500 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 1p0P6V-0003wM-NJ for help-gnu-emacs@gnu.org; Wed, 30 Nov 2022 10:34:36 -0500 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 1p0P6S-0005lH-ER for help-gnu-emacs@gnu.org; Wed, 30 Nov 2022 10:34:31 -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=sCtYeYBcvKdQNHEhsAtVdfrEJpwxwkWnvatyWTLzaAo=; b=bOR2f+SnCsfV iuu/C7ZBecSuDqKEmnx1GrarG3dqfbC8KkR0tF6rt0PtPX0io7tLzVloGsHeKzDvco1IJ9ddDB+2/ whH1znkcdPJ2I8YnnBHxZaId8OxTyDC//f69Ie+QHmFqw5Un2p46J6gap8WH0GbQpw7COU04ROS7Q ZMoqxLNtq6KVWrkHz6Yj54/qgZCTIMz2VWuEtihOngkqP08mtzanjrezcWDY6cY7Y6tqpAT8KzvGQ wJ/6Go5+eJN95J9rna9b/MUDkq3FY7V7hAwfe8bGJeY6b37na85la75C9n2GqKsWqZ5tZD/d0q8cy AzH0rw2fj7SRog0lYSnouQ==; Original-Received: from [87.69.77.57] (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 1p0P6R-00051u-NE for help-gnu-emacs@gnu.org; Wed, 30 Nov 2022 10:34:28 -0500 In-Reply-To: (message from Heime on Wed, 30 Nov 2022 14:40:20 +0000) 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:141275 Archived-At: > Date: Wed, 30 Nov 2022 14:40:20 +0000 > From: Heime > Cc: help-gnu-emacs@gnu.org > > > > Instead of repeating, I want to have a function that adjusts > > > the scale so that the contents of the buffer fit the window, > > > based on the longest line. What can I do? > > > > Ask Emacs about the pixel-height of the text, then compute the scale you > > need to make that the same as the pixel-height of the window's body. > > Are you discussing line-pixel-height and window-pixel-height ? No, I thought about window-text-pixel-size and window-body-height.