I want to make a timer, like this one:
(defun dumb (y)
(defun P () (print y))
(run-with-timer 0 5 'P))
(dumb 5)
Then Emacs gives me this error:
Error running timer `P': (void-variable y)
I guess the problem is that in the (defun P () (print y))
line, the variable y
is not evaluated, so when I run (dumb 5)
, the function P
tries to print y
, which is undefined, instead of a literal 5
. But I don't know how to solve it. Any idea?