Answers:
您可以滚动自己的谓词函数,该函数等待3秒并始终返回non-nil(除非它被中断C-g):
(setq confirm-kill-emacs
(lambda (&rest args)
(interactive)
(message "Quitting in 3 seconds. Press `C-g' to stop.")
(sleep-for 3)
t))
或将读取任何密钥的变体:
(setq confirm-kill-emacs
(lambda (&rest args)
(interactive)
(null (read-event "Quitting in 3 seconds. Hit any key to stop."
nil 3))))