summaryrefslogtreecommitdiff
path: root/lisp/ibuf-ext.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ibuf-ext.el')
-rw-r--r--lisp/ibuf-ext.el34
1 files changed, 13 insertions, 21 deletions
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index d09a6cfa690..1b8099e6182 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -7,6 +7,7 @@
;; Maintainer: John Paul Wallington <jpw@gnu.org>
;; Created: 2 Dec 2001
;; Keywords: buffer, convenience
+;; Package: ibuffer
;; This file is part of GNU Emacs.
@@ -91,11 +92,6 @@ regardless of any active filters in this buffer."
(defvar ibuffer-tmp-show-regexps nil
"A list of regexps which should match buffer names to always show.")
-(defvar ibuffer-auto-mode nil
- "If non-nil, Ibuffer auto-mode should be enabled for this buffer.
-Do not set this variable directly! Use the function
-`ibuffer-auto-mode' instead.")
-
(defvar ibuffer-auto-buffers-changed nil)
(defcustom ibuffer-saved-filters '(("gnus"
@@ -220,6 +216,16 @@ Currently, this only applies to `ibuffer-saved-filters' and
(ibuffer-included-in-filters-p buf ibuffer-filtering-qualifiers)
(ibuffer-buf-matches-predicates buf ibuffer-always-show-predicates)))))
+;;;###autoload
+(define-minor-mode ibuffer-auto-mode
+ "Toggle use of Ibuffer's auto-update facility.
+With numeric ARG, enable auto-update if and only if ARG is positive."
+ 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))
+
(defun ibuffer-auto-update-changed ()
(when (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed)
(dolist (buf (buffer-list))
@@ -230,20 +236,6 @@ Currently, this only applies to `ibuffer-saved-filters' and
(ibuffer-update nil t)))))))
;;;###autoload
-(defun ibuffer-auto-mode (&optional arg)
- "Toggle use of Ibuffer's auto-update facility.
-With numeric ARG, enable auto-update if and only if ARG is positive."
- (interactive)
- (unless (derived-mode-p 'ibuffer-mode)
- (error "This buffer is not in Ibuffer mode"))
- (set (make-local-variable 'ibuffer-auto-mode)
- (if arg
- (plusp arg)
- (not ibuffer-auto-mode)))
- (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; Initialize state vector
- (add-hook 'post-command-hook 'ibuffer-auto-update-changed))
-
-;;;###autoload
(defun ibuffer-mouse-filter-by-mode (event)
"Enable or disable filtering by the major mode chosen via mouse."
(interactive "e")
@@ -1316,7 +1308,8 @@ a prefix argument reverses the meaning of that variable."
(error "No buffer with name %s" name)
(goto-char buf-point)))))
-(declare-function diff-sentinel "diff" (code))
+(declare-function diff-sentinel "diff"
+ (code &optional old-temp-file new-temp-file))
(defun ibuffer-diff-buffer-with-file-1 (buffer)
(let ((bufferfile (buffer-local-value 'buffer-file-name buffer))
@@ -1602,5 +1595,4 @@ defaults to one."
;; generated-autoload-file: "ibuffer.el"
;; End:
-;; arch-tag: 9af21953-deda-4c30-b76d-f81d9128e76d
;;; ibuf-ext.el ends here