reddit / emacs
How to temporarily change font size?
zoliky · 2022-05-29 11:14
Hi, I'm working with a document that contains phonetic symbols and the default font size I use for coding is a little small. Is there a command in Emacs that allows me to increase the font size but only for the current session? I mean until I exit Emacs.
lunkdjedi · 2022-05-29 11:25
C-x C-=
anaumann · 2022-05-29 12:07
Ctrl-Mousewheel for me :)
bakuretsu · 2022-05-29 12:09
I use these little functions from Steve Purcell: https://github.com/aaronbieber/dotfiles/blob/master/configs/emacs.d/lisp/init-fonts.el#L37
BettaGeorge · 2022-05-29 13:07
You can do it buffer-locally by calling `text-scale-increase`. For me, that does not carry over into the next session. I have bound `text-scale-increase` and `-decrease` to `C-=` and `C--`, respectively.
00-11 · 2022-05-29 13:20
See Emacs Wiki [Changing Font Size](https://www.emacswiki.org/emacs/SetFonts#ChangingFontSize), with its sections [Zoom Buffer](https://www.emacswiki.org/emacs/SetFonts#ZoomBuffer) and [Zoom Frame](https://www.emacswiki.org/emacs/SetFonts#ZoomFrame).
vidbina · 2022-05-29 13:24
Funny... was just scrolling through some Purcell magic (envrc and exec-path-from-shell related) a few minutes ago. So much respect for Steve's work. 🏆🥳
Is that implementation the ancestor to https://github.com/purcell/default-text-scale? Looks a bit familiar. 🤔 I'm using that at the moment and pretty happy about it. Do you have a particular reason to prefer this over default-text-scale or was it just a matter of "it works and I don't need anything else ATM" 🤷🏿♂️?
bakuretsu · 2022-05-29 13:36
I suspect that my snippet is an ancestor based on the name; I lifted my code out of Steve's config years ago and I only occasionally use it but it works when I need it so I haven't taken time to consider alternatives.
I just learned about `text-scale-increase` from this thread and I don't see why I shouldn't just use that, so I may experiment.
purcell · 2022-05-29 13:50
Yes, that code is indeed the ancestor of that package. I use the packaged version myself now. And thanks for the kind words.
purcell · 2022-05-29 13:51
That one is great if you just want bigger or smaller text in the current buffer.
HARITHKAUSHIK16 · 2022-05-29 14:53
The prevailing ethos among emacs users is to ignore the existence of the mouse, but as someone who still occasionally uses it, C-Mousewheel is genius!
bakuretsu · 2022-05-29 14:57
I didn't know about the packaged version until just now, so I think I'll delete that spaghetti file I've been self-maintaining :)
_viz_ · 2022-05-29 14:57
That "ethos" is BS IMO. Emacs comes with a lot of thoughtful mouse commands OOTB.
HARITHKAUSHIK16 · 2022-05-29 15:01
What are some other examples? This doesn't get talked about a lot lol.
_viz_ · 2022-05-29 15:15
See my thread from the other day: https://old.reddit.com/r/emacs/comments/uxh0dy/a_mousedriven_emacs/. I leave out the obvious like the clickable links in *Help* buffer, mouse bindings in *Occur*, *grep*, etc.
oantolin · 2022-05-29 15:23
I know `text-scale-adjust` really is bound to `C-x C-=` but I cannot bring myself to use that binding, it feels so wrong. I always use `C-x C-+` even though it's harder to type...
dpoggio · 2022-05-29 17:53
Do what your muscles want to do. Bind to `C-x C-+`.
dpoggio · 2022-05-29 18:00
A lot is in the manual. `gdb-many-windows` is a great example of mouse actually doing some very useful things. https://www.gnu.org/software/emacs/manual/html_node/emacs/GDB-Graphical-Interface.html
oantolin · 2022-05-29 18:26
I don't have to bind it myself, that's also a default binding.
anaumann · 2022-05-30 09:09
But it's consistent with what I use to zoom my browser windows :D