dimensions when doing text-scale-increase, and including minibuffer in text-scale-increase

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

dimensions when doing text-scale-increase, and including minibuffer in text-scale-increase

Samuel Wales
question 1:

if i want to know the usable default dimensions in human lines and
columns terms, i can do:

(let ((r (list (frame-width)
                 (frame-height))))
    (message "%s =frame width and height =(should be (110 32) at
/native resolution 1440/ with /dpi of 216/)"
             r)

but if i do text-scale-increase the result is the same.  i want to
know the same data about what is /there now/.


question 2 (only silghtly related):

i want to do text-scale increase on exactly the active buffer and
"its" minibuffer, but not any other buffers.  i'd prefer modeline not
increase, however.

whenever i switch back to the increased buffer, i want it and "its"
echo area / minibuffer to still be increased.


thank you.

Reply | Threaded
Open this post in threaded view
|

Re: dimensions when doing text-scale-increase, and including minibuffer in text-scale-increase

Eli Zaretskii
> From: Samuel Wales <[hidden email]>
> Date: Tue, 10 Dec 2019 12:28:29 -0700
>
> question 1:
>
> if i want to know the usable default dimensions in human lines and
> columns terms, i can do:
>
> (let ((r (list (frame-width)
>                  (frame-height))))
>     (message "%s =frame width and height =(should be (110 32) at
> /native resolution 1440/ with /dpi of 216/)"
>              r)
>
> but if i do text-scale-increase the result is the same.

Yes, because frame-width and frame-height return values in units of
the canonical character size.

> i want to know the same data about what is /there now/.

Then use frame-pixel-width and frame-pixel-height, and divide by
default-font-width and default-font-height to get the results in
columns and lines.

> i want to do text-scale increase on exactly the active buffer and
> "its" minibuffer, but not any other buffers.  i'd prefer modeline not
> increase, however.
>
> whenever i switch back to the increased buffer, i want it and "its"
> echo area / minibuffer to still be increased.

For the echo area and the minibuffer you will have to use hooks,
because switching to another buffer doesn't switch the echo-area or
minibuffer.  IOW, there's no separate echo-area/minibuffer for each
buffer.


Reply | Threaded
Open this post in threaded view
|

Re: dimensions when doing text-scale-increase, and including minibuffer in text-scale-increase

Samuel Wales
On 12/10/19, Eli Zaretskii <[hidden email]> wrote:
> For the echo area and the minibuffer you will have to use hooks,
> because switching to another buffer doesn't switch the echo-area or
> minibuffer.  IOW, there's no separate echo-area/minibuffer for each
> buffer.

thank you.

i decided i am about equally ok with increasing all buffers including
minibuffer / echo area.  i could not find a buffer switch hook.
however, i can't seem to find minibuffer or echo area buffer in the
buffer list:

(dolist (buffer (buffer-list))
    (with-current-buffer buffer
      (text-scale-increase amount)))

works for only regular buffers.  i presume they are supposed to be
done separately?


i noticed that (default-font-width) is not in emacs 24.  i presume it
got added in a later version.

Reply | Threaded
Open this post in threaded view
|

Re: dimensions when doing text-scale-increase, and including minibuffer in text-scale-increase

Eli Zaretskii
> From: Samuel Wales <[hidden email]>
> Date: Sun, 22 Dec 2019 14:05:10 -0700
> Cc: [hidden email]
>
> i could not find a buffer switch hook.

I think you want window-configuration-change-hook.

> however, i can't seem to find minibuffer or echo area buffer in the
> buffer list:
>
> (dolist (buffer (buffer-list))
>     (with-current-buffer buffer
>       (text-scale-increase amount)))
>
> works for only regular buffers.  i presume they are supposed to be
> done separately?

Not sure, but buffer-list definitely returns minibuffers as well.

> i noticed that (default-font-width) is not in emacs 24.  i presume it
> got added in a later version.

Yes, in Emacs 25.

Reply | Threaded
Open this post in threaded view
|

Re: dimensions when doing text-scale-increase, and including minibuffer in text-scale-increase

Michael Heerdegen
In reply to this post by Samuel Wales
Samuel Wales <[hidden email]> writes:

> however, i can't seem to find minibuffer or echo area buffer in the
> buffer list:

AFAIK minibuffers get reset to defaults all the time, and new
minibuffers can be created on the fly anyway, so you want to do this in
a hook (`minibuffer-setup-hook' probably).  Dunno about echo areas.

Michael.