all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: daniela-spit@gmx.it
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Making windows have same number of columns
Date: Thu, 26 Nov 2020 23:05:08 +0100	[thread overview]
Message-ID: <871rgfu63v.fsf@gmx.net> (raw)
In-Reply-To: <trinity-2510c8e8-661f-4f2c-a32a-4345cde33966-1606425588435@3c-app-mailcom-bs06> (daniela-spit@gmx.it's message of "Thu, 26 Nov 2020 22:19:48 +0100")

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



  reply	other threads:[~2020-11-26 22:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 14:43 Making windows have same number of columns daniela-spit
2020-11-26 16:03 ` Stephen Berman
2020-11-26 16:18   ` Stephen Berman
2020-11-26 17:16   ` daniela-spit
2020-11-26 18:26   ` daniela-spit
2020-11-26 18:55     ` Stephen Berman
2020-11-26 19:01       ` daniela-spit
2020-11-26 19:21         ` Stephen Berman
2020-11-26 19:30           ` daniela-spit
2020-11-26 19:41             ` Stephen Berman
2020-11-26 20:22               ` daniela-spit
2020-11-26 20:31                 ` Stephen Berman
2020-11-26 21:19                   ` daniela-spit
2020-11-26 22:05                     ` Stephen Berman [this message]
2020-11-26 23:01                       ` Drew Adams
2020-11-26 23:07                         ` daniela-spit
2020-11-26 23:55                           ` daniela-spit
2020-11-27  0:51                             ` Drew Adams
2020-11-27  1:03                               ` daniela-spit
2020-11-27 15:37                       ` Stephen Berman
2020-11-26 21:42                   ` daniela-spit
2020-11-27 20:40                     ` Michael Heerdegen
2020-11-26 19:33           ` daniela-spit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rgfu63v.fsf@gmx.net \
    --to=stephen.berman@gmx.net \
    --cc=daniela-spit@gmx.it \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.