1

I know this solution is posted, but I cannot find it. I had in my .emacs code to kill suggestions buffers automatically after n seconds (mine was set to 5). This allowed me to not have to switch to that pane and kill it or have 90 auto-complete or suggestions buffers open. I can no longer find the code though. Does anybody know how to do this?

Thanks

JohnML
  • 73
  • 1
  • 5

2 Answers2

1

Try Midnight Mode, included with recent versions of Emacs.

Daniel Martín
  • 7,815
  • 1
  • 29
  • 34
  • 1
    Where "recent" means since 20/08/1998 :) – phils Feb 02 '13 at 01:04
  • I'm not sure midnight mode is appropriate here, mind. This sounds more like a job for a custom timer (`C-h i g` `(elisp) Timers` `RET`) – phils Feb 02 '13 at 01:26
0
(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).

You define a function x-function that kills buffers you want.

alinsoar
  • 15,386
  • 4
  • 57
  • 74