I have variables foo and bar. I have a function that modifies foo and I can't change that function.
How can I redirect the change made to foo so it applies to bar instead?
EDIT :
I want this redirection to track real time change.
What I am trying to achieve :
I want to swap the headerline with the modeline. I did this with this snippet of code :
(defvar og-modeline mode-line-format)
(setq-default mode-line-format header-line-format)
(setq-default header-line-format og-modeline)
It works well but when something from an other package makes change to the headerline it obviously uses header-line-format but I want instead those change to be done to mode-line-format. Thus why I ask if there is the possibility to redirect changes.