I want to make a function that calls run-at-time
while setting its repeat to nil. The only thing I want to be asked to supply is the duration after which run-at-time should call a function.
Evaluating the following does what I want except for interactively asking me to input the duration: (run-at-time "120 min" nil 'my-custom-command)
None of my attempts to turn this into an interactive function have succeeded.
I have tried the following:
(defun foo ()
(interactive)
(call-interactively 'run-at-time 'my-custom-command))
However, evaluating this causes me to be asked to input run-at-time
's repeat variable and the function to be called, neither of which I wish to supply. Putting 'nil' after 'run-at-time' to bypass the request for the repeat interval returns a "too many arguments" error message.
I have experimented within the forms of run-at-time
(run-at-time TIME REPEAT FUNCTION &rest ARGS) and call-interactively
(call-interactively FUNCTION &optional RECORD-FLAG KEYS), but to no avail.
I have also tried using the "s" and "n" flags (perhaps incorrectly) in case they might allow a string or a number to supply run-at-time's duration, but though this results in a string or a number being asked for, supplying either returns an error message.
What would make this function work?