我有这个代码:
(defun do-repeated-work (args)
"some work that need executed repeatedly"
(message nil)
(message "doing some repeated work, arg = %s, current time = %s" args (format-time-string "%H:%M:%S")))
(setq timer (run-with-idle-timer 3 t 'do-repeated-work (list "arg1" "arg2" "arg3")))
上面代码的目的是:每三秒在 minibuffer 中重复打印一行消息。但是我发现,当该功能do-repeated-work
再次起作用时,无法清除emacs minibuffer中的旧消息,因此无法显示新消息。我已经尝试过这个问题中提到的方式:如何清空或清除emacs minibuffer?,但它不起作用。
我的 Emacs 版本是 25.3
如何应对这个问题?