How can I auto run a function when open a new buffer, say text-scale-adjust.
A slightly more detailed version of abo-abo's answer:
(add-hook 'find-file-hook
'(lambda () (text-scale-adjust 1)))
This will run for all files you visit. You can look at mode-specific hooks if you want to tailor which types of files/buffers get this treatment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With