all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	"carlmarcos@tutanota.com" <carlmarcos@tutanota.com>
Cc: "56357@debbugs.gnu.org" <56357@debbugs.gnu.org>
Subject: bug#56357: Request for font size adaptation that fits window
Date: Mon, 4 Jul 2022 15:54:34 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488B95226B31A9A8128FFBDF3BE9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <871qv187lr.fsf@gnus.org>

> > Suppose a user uses a 13 pt font size.  Let there be some space
> > between the longest line in the buffer and the edge of the window.
> > It would be super if the font size could be automatically increased,
> > such that the difference between the longest line and the window 
> > size in minimised.
> 
> I think that sounds like a useful feature, and I'm kinda surprised that
> it doesn't exist yet.  Or does it?  Anybody know?
> 
> To implement this, I guess the obvious thing would be to have a global
> minor mode that'd listen to frame size changes, and then adjust the
> font size up/down to reach the desired number of characters in a frame?
> So we'd have a user option font-size-adjust-target (defaulting to 80)
> and a font-size-adjust-mode?

Not sure, but I have a feeling this feature might be
related to what you're thinking about / looking for.
It doesn't sound like it's exactly what this report
has requested.  But it sounds like it's related and
it might even address the underlying need/problem.

My library `face-remap+.el' introduces option
`text-scale-resize-window', which automatically resizes
the selected window (horizontally, vertically, or both)
when text is resized.  This means that when you resize
text the way the window fits the text remains relatively
constant.  Shrinking the text in one window shrinks that
window, giving more space to adjacent windows.

IOW, it keeps whatever relation currently exists between
the apparent text size and the window size.  That also
means that it lets you take advantage of the space freed
up by resizing (text-scaling) to a smaller font.

I offered this feature to Emacs dev _long_ ago (as soon
as text-scaling was added to Emacs).  It was summarily
rejected, with a no-one-would-ever-want-to-do-that
dismissal.  But personally, I wouldn't use text scaling
without such a feature.

I see, and saw, no reason not to give users the choice,
as opposed to hard-coding the behavior so as to always
waste screen real estate with added blank space when
text is shrunk.

The code is trivial - a tweak to `text-scale-increase'
to respect the new user option.  The code is here:

https://www.emacswiki.org/emacs/download/face-remap%2b.el





      parent reply	other threads:[~2022-07-04 15:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02 12:17 bug#56357: Request for font size adaptation that fits window carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-03  3:39 ` Richard Stallman
2022-07-04 11:01 ` Lars Ingebrigtsen
2022-07-04 11:42   ` Eli Zaretskii
2022-07-04 13:54     ` Lars Ingebrigtsen
2022-07-04 14:05       ` Eli Zaretskii
2022-07-04 19:25     ` carlmarcos--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-05 11:11       ` Lars Ingebrigtsen
2022-07-05 15:33         ` Christopher Dimech
2022-07-04 15:54   ` Drew Adams [this message]

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=SJ0PR10MB5488B95226B31A9A8128FFBDF3BE9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=56357@debbugs.gnu.org \
    --cc=carlmarcos@tutanota.com \
    --cc=larsi@gnus.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.