I want to do something VERY simple. I want to create a minor mode, which when enabled sets a buffer-local variable (say left-margin-width
, for instance) with a specific value.
I can do this:
(define-minor-mode margin-mode
(setq left-margin-width 3))
Now, I want the variable to take back it's global value when margin-mode
is disabled. To me this seems like a very natural use-case, but apparently I can't find a simple and easy way to do his yet! Once enabled, the variable retains it's value until the buffer is closed. Which is very undesirable.
Help!