1

The official Emacs documentation says:

...to change the sizes of the fonts globally, type C-x C-M-+, C-x C-M-=, C-x C-M-- or C-x C-M-0,...1

Unfortunately, when I type C-x C-M-+ on my laptop's keyboard2, the error message C-x C-M-+ is undefined appears in the mini-buffer.

Mysteriously enough, I have not been able to find out the command that would have been executed upon typing C-x C-M-+ if the documentation had been correct.

This is all old-news for me, actually.

In fact, I had already resigned myself to there not being any convenient way to globally modify the font size in Emacs.

But the other day, while I was in the middle of a Zoom meeting for work, sharing my screen, and viewing an Emacs window, I accidentally typed something that caused the font-size of the Emacs buffer to become larger. Further (as I was able to confirm after the meeting ended), this font-size change was global.

Even though this incident did startle me when it happened, I could not investigate it further at the time, because I was in the middle of an important discussion with my team at work.

To make matters worse, this discussion went on for another hour or so, during which I had to run multiple Emacs commands. As a result, by the time I had a chance to run view-lossage, there was no longer any trace of the mystery shortcut I had stumbled upon.

I have spent a long time since then, trying to replicate this shortcut, in vain.

In fact, I can't swear that what I did to change the font-size was only typing something. I may have been doing something else at the same time, such as moving the cursor, etc.

Be that as it may, the experience convinced me that there is in Emacs, after all, a reasonably convenient way to change the font size globally, and I really would like to find out what it is.

In summary, my question is: what is the mystery shortcut that causes the font size in Emacs to change globally?

I should point out that this thread addresses the same problem, but none of the answers given there answer the question raised above.


1 The documentation continues with "or scroll the mouse wheel with both the Ctrl and Meta modifiers pressed". Unfortunately, with my (extremely "mouseless") MacBook Pro laptop, AFAIK, there is no way to simulate this mouse-wheel-based interaction, so this method, whether it works or not under the right circumstances, is of no use to me.
2 Namely, by first simultaneously pressing controlx, and then simultaneously pressing controloptionshift+
=
.

3
  • 1
    You're sure it was only the text in Emacs that changed size, not everything in your Zoom session? Did window/frame sizes in Emacs also change size?
    – Drew
    Sep 8, 2023 at 15:56
  • @Drew: All good questions. I did not notice a size change anywhere else; only in Emacs. In particular, my sole Emacs window was "maximalized" (i.e. what one gets on a Mac by clicking on the green button in the window's top-left corner while simultaneously pressing <kbd>option</kbd>). Since the change I observed was an increase in the font size, it would not have been possible to have a similar change in the window size.
    – kjo
    Sep 8, 2023 at 16:24
  • "I have not been able to find out the command that would have been executed...", the documentation you mention: text-scale-adjust in the first paragraph. Sep 8, 2023 at 17:36

3 Answers 3

2

You asked multiple questions, but these keys are normally bound to global-text-scale-adjust. You can create those key bindings in the usual way; there’s nothing special about them.

Obviously, if you want to find out why you don’t have them, the easiest thing to do is check that you do have them when you run emacs -Q, and then bisect your config from there.

1

There is no mystery - you interacted with operating system; to convince yourself, place the point on the green button, hovering; the popup will show you three options, the first one being Enter Full Screen. If you press the option key, the first item will change to Zoom. The rest may depend on your configuration.

Depending on your needs, it may be useful to keep the option key free.

As for the documentation, what you show us is for Emacs 29.1, and are the new implementations, works as described (I have also a Mac), so it is possible to be not working if you have a previous version.

0

Which version of Emacs are you using? The commands and key bindings that you reference were added in Emacs 29.1.

(If you are not using the current stable version of Emacs, you will sometimes run into conflicts with the online documentation. I recommend always reading the manual inside Emacs, as that is the manual for the version you're using. You can jump directly to that same page in your local manual using C-hig (emacs)Text Scale in order to compare. If you're not familiar with the info reader, type h in its buffer to go through the tutorial, which will be extremely valuable.)

If you want to globally change the font size on earlier versions, changing the Height of the default face via M-x customize-face RET default RET should cover most things. I'm not familiar with any standard key binding for doing that (or similar) though.

If you want to change the font size in only a single buffer, C-xC-= and C-xC-- will work (in GUI frames) since Emacs 23. (In terminal frames the terminal controls the font size, and it might provide its own key bindings for changing it, but that's all external to Emacs.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.