我知道这个解决方案已发布,但我找不到它。我在我的 .emacs 代码中有在 n 秒后自动终止建议缓冲区(我的设置为 5)。这使我不必切换到该窗格并杀死它或打开 90 个自动完成或建议缓冲区。我再也找不到代码了。有人知道怎么做这个吗?
谢谢
试试Midnight Mode,它包含在最新版本的 Emacs 中。
(run-with-idle-timer SECS REPEAT 'x-function)
Perform an action the next time Emacs is idle for SECS seconds.
The action is to call FUNCTION with arguments ARGS.
SECS may be an integer, a floating point number, or the internal
time format returned by, e.g., `current-idle-time'.
If Emacs is currently idle, and has been idle for N seconds (N < SECS),
then it will call FUNCTION in SECS - N seconds from now.
If REPEAT is non-nil, do the action each time Emacs has been idle for
exactly SECS seconds (that is, only once for each time Emacs becomes idle).
你定义一个函数 x-function 来杀死你想要的缓冲区。