bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48307: Feature request: provide default keybindings to change the fo


From: Gregory Heytings
Subject: bug#48307: Feature request: provide default keybindings to change the font size in all windows
Date: Sun, 09 May 2021 20:16:16 +0000



Not all the implementations are good, and it would be very nice if such a feature were available out of the box.


Would the following do what you want?

(defun global-text-scale-adjust-do (increment)
  (set-face-attribute 'default nil :height
                      (+ (face-attribute 'default :height) increment))
  (message "Use + and - for further adjustment")
  (set-transient-map
   (let ((map (make-sparse-keymap)))
     (define-key map (kbd "+") 'global-text-scale-adjust-increase)
     (define-key map (kbd "-") 'global-text-scale-adjust-decrease)
     map)))
(defun global-text-scale-adjust-increase ()
  (interactive)
  (global-text-scale-adjust-do +5))
(defun global-text-scale-adjust-decrease ()
  (interactive)
  (global-text-scale-adjust-do -5))
(global-set-key (kbd "C-x M-+") 'global-text-scale-adjust-increase)
(global-set-key (kbd "C-x M--") 'global-text-scale-adjust-decrease)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]