+;;;###autoload
+(define-minor-mode ibuffer-auto-mode
+ "Toggle use of Ibuffer's auto-update facility (Ibuffer Auto mode).
+With a prefix argument ARG, enable Ibuffer Auto mode if ARG is
+positive, and disable it otherwise. If called from Lisp, enable
+the mode if ARG is omitted or nil."
+ nil nil nil
+ (unless (derived-mode-p 'ibuffer-mode)
+ (error "This buffer is not in Ibuffer mode"))
+ (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; Initialize state vector
+ (add-hook 'post-command-hook 'ibuffer-auto-update-changed))
+