Questions tagged [variable-watchers]

4 questions
7
votes
4 answers

Tracking when variables get updated

I have a problem with org-mode's agenda view. While I've set org-agenda-files to '("~/org/") invariably when I finally spin up M-x org-agenda I find that org-agenda-files just points to one org-file. Obviously something is deciding just to include…
stsquad
  • 4,626
  • 28
  • 45
5
votes
1 answer

Function add-variable-watcher does not watch "last-command" variable

I have added a watcher function to watch the last-command variable. (defun my-watch (symbol newval op where) (message "Hello")) (add-variable-watcher 'last-command #'my-watch) The function my-watch does not get invoked at all. How to watch for a…
Talespin_Kit
  • 435
  • 2
  • 11
1
vote
0 answers

Can I somehow hook a variable?

So a function is called when the variable value is changed? add-hook seems to only accept functions.
xeruf
  • 324
  • 1
  • 12
0
votes
1 answer

Redirect change made to a variable to another variable

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…
Virgil
  • 3
  • 3