mirror of
https://github.com/larstvei/dot-emacs.git
synced 2024-11-26 07:28:31 +00:00
Rewrote global-scale
This commit is contained in:
parent
98bb09cf8e
commit
3c7624d8f5
24
init.org
24
init.org
@ -891,22 +891,30 @@
|
||||
generalized (or maybe be substituted by a package if it's out there).
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(lexical-let* ((default (face-attribute 'default :height))
|
||||
(size default))
|
||||
|
||||
(defun global-scale-default ()
|
||||
(interactive)
|
||||
(set-face-attribute 'default nil :font "Inconsolata-14"))
|
||||
(setq size default)
|
||||
(global-scale-internal size))
|
||||
|
||||
(lexical-let ((size 14))
|
||||
(defun global-scale-up ()
|
||||
(interactive)
|
||||
(set-face-attribute
|
||||
'default nil
|
||||
:font (concat "Inconsolata-" (number-to-string (incf size)))))
|
||||
(global-scale-internal (incf size 20)))
|
||||
|
||||
(defun global-scale-down ()
|
||||
(interactive)
|
||||
(set-face-attribute
|
||||
'default nil
|
||||
:font (concat "Inconsolata-" (number-to-string (decf size))))))
|
||||
(global-scale-internal (decf size 20)))
|
||||
|
||||
(defun global-scale-internal (arg)
|
||||
(set-face-attribute 'default nil :height arg)
|
||||
(set-temporary-overlay-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map (kbd "C-=") 'global-scale-up)
|
||||
(define-key map (kbd "C-+") 'global-scale-up)
|
||||
(define-key map (kbd "C--") 'global-scale-down)
|
||||
(define-key map (kbd "C-0") 'global-scale-default) map))))
|
||||
#+END_SRC
|
||||
|
||||
* Mode specific
|
||||
|
Loading…
Reference in New Issue
Block a user