Function: global-text-scale-adjust
global-text-scale-adjust is an autoloaded, interactive and
byte-compiled function defined in face-remap.el.gz.
Signature
(global-text-scale-adjust INCREMENT)
Documentation
Change (a.k.a. "adjust") the font size of all faces by INCREMENT.
Interactively, INCREMENT is the prefix numeric argument, and defaults to 1. Positive values of INCREMENT increase the font size, negative values decrease it.
When you invoke this command, it performs the initial change of the font size, and after that allows further changes by typing one of the following keys immediately after invoking the command:
\+, \= Globally increase the height of the default face
\- Globally decrease the height of the default face
\0 Globally reset the height of the default face
(The change of the font size produced by these keys depends on the
final component of the key sequence, with all modifiers removed.)
Buffer-local face adjustments have higher priority than global face adjustments.
The variable global-text-scale-adjust-resizes-frames controls
whether the frames are resized to keep the same number of lines
and characters per line when the font size is adjusted.
See also the related command text-scale-adjust. Unlike that
command, which scales the font size with a factor,
global-text-scale-adjust scales the font size with an
increment.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/face-remap.el.gz
;;;###autoload (define-key ctl-x-map [(control meta ?+)] 'global-text-scale-adjust)
;;;###autoload (define-key ctl-x-map [(control meta ?=)] 'global-text-scale-adjust)
;;;###autoload (define-key ctl-x-map [(control meta ?-)] 'global-text-scale-adjust)
;;;###autoload (define-key ctl-x-map [(control meta ?0)] 'global-text-scale-adjust)
;;;###autoload
(defun global-text-scale-adjust (increment)
"Change (a.k.a. \"adjust\") the font size of all faces by INCREMENT.
Interactively, INCREMENT is the prefix numeric argument, and defaults
to 1. Positive values of INCREMENT increase the font size, negative
values decrease it.
When you invoke this command, it performs the initial change of the
font size, and after that allows further changes by typing one of the
following keys immediately after invoking the command:
\\`+', \\`=' Globally increase the height of the default face
\\`-' Globally decrease the height of the default face
\\`0' Globally reset the height of the default face
(The change of the font size produced by these keys depends on the
final component of the key sequence, with all modifiers removed.)
Buffer-local face adjustments have higher priority than global
face adjustments.
The variable `global-text-scale-adjust-resizes-frames' controls
whether the frames are resized to keep the same number of lines
and characters per line when the font size is adjusted.
See also the related command `text-scale-adjust'. Unlike that
command, which scales the font size with a factor,
`global-text-scale-adjust' scales the font size with an
increment."
(interactive "p")
(when (display-graphic-p)
(unless global-text-scale-adjust--default-height
(setq global-text-scale-adjust--default-height
(face-attribute 'default :height)))
(let* ((key (event-basic-type last-command-event))
(echo-keystrokes nil)
(cur (face-attribute 'default :height))
(inc
(pcase key
(?- (* (- increment)
global-text-scale-adjust--increment-factor))
(?0 (- global-text-scale-adjust--default-height cur))
(_ (* increment
global-text-scale-adjust--increment-factor))))
(new (+ cur inc)))
(when (< (car global-text-scale-adjust-limits)
new
(cdr global-text-scale-adjust-limits))
(let ((frame-inhibit-implied-resize
(not global-text-scale-adjust-resizes-frames)))
(set-face-attribute 'default nil :height new)
(redisplay 'force)
(when (and (not (and (characterp key) (= key ?0)))
(= cur (face-attribute 'default :height)))
(setq global-text-scale-adjust--increment-factor
(1+ global-text-scale-adjust--increment-factor))
(global-text-scale-adjust increment))))
(when (characterp key)
(set-transient-map
(let ((map (make-sparse-keymap)))
(dolist (mod '(() (control meta)))
(dolist (key '(?+ ?= ?- ?0))
(define-key map (vector (append mod (list key)))
'global-text-scale-adjust)))
map)
nil nil
"Use %k for further adjustment")))))