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
28
init.org
28
init.org
@ -891,22 +891,30 @@
|
|||||||
generalized (or maybe be substituted by a package if it's out there).
|
generalized (or maybe be substituted by a package if it's out there).
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun global-scale-default ()
|
(lexical-let* ((default (face-attribute 'default :height))
|
||||||
(interactive)
|
(size default))
|
||||||
(set-face-attribute 'default nil :font "Inconsolata-14"))
|
|
||||||
|
(defun global-scale-default ()
|
||||||
|
(interactive)
|
||||||
|
(setq size default)
|
||||||
|
(global-scale-internal size))
|
||||||
|
|
||||||
(lexical-let ((size 14))
|
|
||||||
(defun global-scale-up ()
|
(defun global-scale-up ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(set-face-attribute
|
(global-scale-internal (incf size 20)))
|
||||||
'default nil
|
|
||||||
:font (concat "Inconsolata-" (number-to-string (incf size)))))
|
|
||||||
|
|
||||||
(defun global-scale-down ()
|
(defun global-scale-down ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(set-face-attribute
|
(global-scale-internal (decf size 20)))
|
||||||
'default nil
|
|
||||||
:font (concat "Inconsolata-" (number-to-string (decf size))))))
|
(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
|
#+END_SRC
|
||||||
|
|
||||||
* Mode specific
|
* Mode specific
|
||||||
|
Loading…
Reference in New Issue
Block a user