From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Making windows have same number of columns Date: Thu, 26 Nov 2020 23:05:08 +0100 Message-ID: <871rgfu63v.fsf@gmx.net> References: <87wny8t89u.fsf@gmx.net> <87o8jkt0c0.fsf@gmx.net> <87k0u7udo1.fsf@gmx.net> <87czzzucqt.fsf@gmx.net> <878sanuafx.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30456"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Help Gnu Emacs To: daniela-spit@gmx.it Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 26 23:06:01 2020 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 1kiPOp-0007lr-QF for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 26 Nov 2020 23:05:59 +0100 Original-Received: from localhost ([::1]:54626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kiPOo-000523-Nm for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 26 Nov 2020 17:05:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiPO8-00051k-VE for help-gnu-emacs@gnu.org; Thu, 26 Nov 2020 17:05:17 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:56099) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiPO7-0002Ux-3E for help-gnu-emacs@gnu.org; Thu, 26 Nov 2020 17:05:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606428312; bh=5QabkVKcLFhpFZe6AFhVK5UbXA0+zgOfdeYRznW5gR0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Fu7gZdM5uu9tVgfjIAN0sQ3CgMM/W9xUZxgNW5HvbW8WoFnrcuWJ78VmQo2BWIXNK 0qAoSK69nzj0w9iIC8WATZHdi+DHKHipNE8fsMPaI4pO5riatnt3mng7LrFsLi0RD3 fzgq31G13oWeQkHHJPdlkAPSD9jeRp+d3qDnW/ro= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([188.109.147.66]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MRTRH-1kWfQT2GLF-00NVER; Thu, 26 Nov 2020 23:05:12 +0100 In-Reply-To: (daniela-spit@gmx.it's message of "Thu, 26 Nov 2020 22:19:48 +0100") X-Provags-ID: V03:K1:P7k7B2KSdi3hWUDC0AWYMM1Bg2bL3TStpclmUsr+/Ro0LGg+302 r7JAzOn/aKBGRHJ/Gt5a2TxvHEd+tDgg5BdkSS8riAdBuWx8VcVeMVVSIH5SLLFYhRTU3Pe WhmoVzy1/kwsE03A76uztHDkrAPOizBnWEa4mBptIe/jI2SvXeVD0clcJ+tEDtWrG9kBk3A nx1JWlLluCwIwf5YGE0Yg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Zx/docLyMFs=:76/EhME+hVVG2/3XhJa2Ky TbJCZ8pl4w9Qxz0kBWs3kWUjNJQlOy6wm6F/IGb3iuQmPB/flu/2qTeAgRvp1VHRSCaGqfTTm POfiXSNfM3bvaDWhq0xmtQYDaZDeTm2DrKjRNIDRepD57bGYx3TgcJbhvYLaghsxogiO7yQsB 8fV4TI4df28m9nYxSML+laVb31jhAAxhlmgVoRy0N3pfqgG8cls3IS9wi+C+S8O6ahQ8jNYYF Xoty8NNfA6LOT/0VR4rXGRGKbnoAFbR0VqeoHvjEIbRwAuw9hCziKfEEQBFhFq6D1+dELFuxe f6epOQ1Hrm00CelSK8ly/HZsmUbJT2hO0cPvVck0OjKqiSN1f1MdwPv+h8fcgvR5cdYPZKY8Y zUWqgHHjD4uss6jzmjBWbN7fC2A39WYlHZP2l7WcDL2MAq/s+VmH/74ynYt/g3Eqq2gcrUA7Z ak6wxFbk0q2fOEHFK2NeN/qIHf6ItO5zMopSvAAPAyENfJadCjyHD7ZQesavjxnG1G67e1cuJ nBzp73zN4dZwHNrevOtN1aUN38w4LPZBhjPVFEmTlODC6YgU2TKeGTijOJujlN95DE86J/hfJ P2lx2Qx7gVx7s3ChZacqaDoHfRwW5fCGKs3pTIQElYv1gGXMX8S3HyfM8eQ6AwGS0mB8fI51n T3uPFpt2MMkLnWV8nlSuN8HU+5ToZvyLMAoo9KK532vpgwtp7QfHhkDx0yYT5taMdsKILlxZT ohrDxIQA3B0MTyqPKA9tVRQRa1Lup7wMwnpI4uktpT2Q/0tJo1ecH7vUO0YCGZmH3nOlQ6E6 Received-SPF: pass client-ip=212.227.15.15; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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:125595 Archived-At: On Thu, 26 Nov 2020 22:42:57 +0100 daniela-spit@gmx.it wrote: > Have started with the following, but when I execute it, nothing happens. > > (defun typh-text-scale () > (interactive) > (setq width (window-body-width)) > (while (< width 72) > (text-scale-adjust -) > (setq width (window-body-width)) )) Changing the font size with text-scale-adjust has no affect on window-body-width; you can only change that by using shrink-window-horizontally or enlarge-window-horizontally if your frame has two or more side-by-side windows, or else if you change the width of the frame. On Thu, 26 Nov 2020 22:19:48 +0100 daniela-spit@gmx.it wrote: > A solution could be to make a defun that performs (text-scale-adjust -) > until (window-body-width) is less than a number N. Instead of changing the window width, one at first sight plausible idea is to check the column at the end the longest line in the buffer after each application of text-scale-adjust; unfortunately, this doesn't work, because using text-scale-adjust does not change how many columns a line takes up: e.g., if the longest line ends at column 82 and window-body-width is 72, then after apply text-scale-adjust until the longest line appears to be shorter than 72, it still ends at column 82. In other words, text-scale-adjust also adjusts the column width. So that approach won't work. I can't think off hand of a way to get what you want, but maybe someone else knows a way. Steve Berman