When I type C-x C-+ the height of the default face in the current buffer is increased. However, when I revert the buffer, the text scaling is reset to normal. I would like to keep the same scaling after reverting the buffer.

Is there a way to determine the amount of scaling in the current buffer, in order to save it and restore the same scaling when a buffer is reverted?


Variable text-scale-mode-amount holds the number of text-scale-mode steps. (Variable text-scale-mode-step holds the amount to scale for each step.)

Save text-scale-mode-amount, then later pass it to text-scale-increase.

| improve this answer | |
  • Thanks, this works well together with before-revert-hook and after-revert-hook.. – Håkon Hægland Apr 25 '15 at 20:03
  • @HåkonHægland could you share your solution? I have the following, but doesn't seem to work: gist.github.com/ustun/f5b5eb447c0e7a02ef67a90324bd8f28 – ustun Nov 1 '16 at 21:06
  • Actually, seems to work. I had some other hook that was ruining it. – ustun Nov 1 '16 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.