I posted Quick Zoom Text in Emacs on Wednesday, 1 January, 2020

Quick Zoom Text in Emacs
Post emacs

Quick Zoom Text in Emacs


Hey, happy new year!

Okay quick scenario: you are at your desk working through some problem in Emacs. This problem is a little tricky, so you call your friend or coworker for advice. They take one look at your screen. They immediately walk away, eyelids twitching. Their old eyes cannot cope with your eight point font on a 4k screen.

If only you could have prevented this tragedy.

You could have, with text-scale-adjust! This built-in function adjusts font size in your current buffer by whatever you have text-scale-mode-step set to.

Table 1. Emacs text scale adjustment key bindings
(text-scale-adjust 1)C-x C-= or C-x C-+Increase text size by one step
(text-scale-adjust -1)C-x C--Decrease text-size by one step
(text-scale-adjust 0)C-x C-0Reset text size to default

On my system, text-scale-mode-step is 1.2. I set default height of fixed-pitch fonts to 120, or 12 points. Increasing the scale by one step makes the default height for that buffer 144 – 14 point, more or less. Again? 172. Again? 207.

You get the point.

text-scale-adjust leaves your other buffers and frame fonts alone. Maybe you prefer adjusting everything at once. I will not judge. Try the default-text-scale package if you want to adjust global font sizes.

Call your friend back over to help on that code problem. Their eyes have probably stopped twitching by now.

And when they go you can get your eight point font back with C-x C-0.

Indieweb Social

Did you mention this somewhere? I'd love it if you sent me the link!

disclaimer about timing

Mentions are sent to webmention.io. I fetch the latest mentions when building the site, so I may not see your feedback right away. Especially if my site's broken, which is often the case.

Public replies and mentions might be shared on the site, but I try to do a little quality check first.

Site Links