help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Re: Run `window-configuration-change-hook` in Lisp code


From: Drew Adams
Subject: RE: [External] : Re: Run `window-configuration-change-hook` in Lisp code?
Date: Fri, 8 Nov 2024 17:47:02 +0000

Coming late to this thread, and with nothing
special to say about the specific trigger/hook
question.

But with something to offer perhaps for the
original/underlying request of allowing a buffer
in `visual-line-mode' to have its window change
size to accommodate text scaling, i.e., keep the
same visual-fill position.

IOW, maybe think of the current discussion as
possibly an X-Y question: you have an idea of
what a solution to your original question might
be, so you ask a question about that (trigger).

If I've misunderstood something, then please
ignore...
___

I brought up the original question decades ago,
as soon as text-scaling was added to Emacs.
Not wrt visual-line-mode, in particular (that
didn't exist back then), but generally.

I suggested that users should be able to
choose whether the window gets automatically
scaled in conjunction with text scaling, i.e.,
as an optional behavior.

For one thing, this saves horizontal screen
space when text is shrunk - wasted blank window
space at line ends.

This was roundly rejected by Eli at the time,
IIRC, saying that no one would ever want such
behavior.

So I implemented it in a little library,
`face-remap+.el' (back in 2009).  I wouldn't
be without it.

It works with and without `visual-line-mode'.
It really has _nothing to do with
`visual-line-mode'_: the question/request is
only about keeping the relation between the
text size and the window size.  It just so
happens that with `visual-line-mode' lines
are visually fit to the window width.


The behavior is controlled by option
`text-scale-resize-window':

text-scale-resize-window is a variable defined in `face-remap+.el’.

Non-nil means text scaling resizes the window or frame accordingly.
For example, if you use ‘C-x C--’ (‘text-scale-decrease’)’ to make the
text smaller, then the window or frame is made smaller by a similar
factor.
___

You can choose to resize the window horizontally
only, vertically only, both, or neither (off).

(There's also a global minor mode,
`text-scale-keep-mode', which when on keeps the
same text-scaling when a buffer changes major mode.
If off, you get the vanilla Emacs behavior that
text-scaling is lost when the major mode changes.)
___

Apologetically, `face-remap+.el' redefines vanilla
function `text-scale-increase', to respect option
`text-scale-resize-window'.

I'd still suggest that such an option be added to
vanilla Emacs, FWIW.  (Better late than never...)
___

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]