Emacs is it possible to get the action of C-x C- - (reduce buffer font size) in emacs lisp?
I'd like to reduce the default font size for a buffer using Emacs lisp.
At the moment I am running a process based buffer as a small emacs-lisp based application, I want the font size to reduce in the same way as C-x C-- does, when 开发者_如何学JAVAthe app creates it's buffer.
The app has it's own major mode, so should I just set a custom basic face instead?
(note: I tried doing C-x ESC ESC but it showed the command executed before C-x C-- instead.)
Thanks to dmckee, Help does of course tell me the command that C-x C-- executes...
The lisp to reduce is...
(text-scale-adjust -1)
to enlarge...
(text-scale-adjust 1)
to reset to default...
(text-scale-adjust 0)
Emacs also provides (which FYI text-scale-adjust
wraps):
(text-scale-increase INC)
;;INC is number of steps to increase
(text-scale-decrease DEC)
;;DEC is number of steps to decrease
In general C-h k [key combination] will tell you what a particular key combination is bound to. My emacs has C-x C--, undefined, but it is version 22.3.1. Perhaps you are using version 23.
精彩评论