Skip to content

Instantly share code, notes, and snippets.

@ustun
Created November 1, 2016 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ustun/f5b5eb447c0e7a02ef67a90324bd8f28 to your computer and use it in GitHub Desktop.
Save ustun/f5b5eb447c0e7a02ef67a90324bd8f28 to your computer and use it in GitHub Desktop.
(defun save-text-scale ()
"Save text-scale."
(message "saving prev text scale %d" text-scale-mode-amount)
(setq text-scale-previous (buffer-local-value 'text-scale-mode-amount (current-buffer))))
(add-hook 'before-revert-hook 'save-text-scale)
(defun restore-text-scale ()
"Restore text-scale."
(message "restoring prev text scale %d" text-scale-previous)
(text-scale-increase text-scale-previous))
(add-hook 'after-revert-hook 'restore-text-scale)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment