2

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?

Håkon Hægland
  • 3,608
  • 1
  • 20
  • 51

1 Answers1

4

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.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • 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: https://gist.github.com/ustun/f5b5eb447c0e7a02ef67a90324bd8f28 – ustun Nov 01 '16 at 21:06
  • Actually, seems to work. I had some other hook that was ruining it. – ustun Nov 01 '16 at 21:12