Let's say, If I have a directory variable named a-directory with its value. Also I have another variable named b-directory which gets its value from the previous variable.
(setq a-directory "C:/Users/Paper")
(setq b-directory (expand-file-name "org-mode.org" a-directory))
Every time when I change the value of a-directory, I need to eval the b-directory again to get its new value. So here comes the question: How can I get the updated value without evaling b-directory when changing the value of a-directory?
b-directorycould be a function:(defun b-directory () (expand-file-name "org-mode.org" a-directory))- in this case it will evaluate the expression every time (slight overhead), but will be always up to date.a-directorydirectly throughsetqbut from achange-a-directoryfunction that would update botha-directoryandb-directory.