]> code.delx.au - gnu-emacs/blobdiff - lisp/ibuffer.el
Fix EOL decoding in vc-annotate with SVN back-end on MS-Windows
[gnu-emacs] / lisp / ibuffer.el
index 8f7d584d00be0bc904dfbd9638520863d22f6374..9d23e64cd81484be7e8fc8377ea9a5fa78211f1a 100644 (file)
@@ -1,6 +1,6 @@
-;;; ibuffer.el --- operate on buffers like dired
+;;; ibuffer.el --- operate on buffers like dired  -*- lexical-binding:t -*-
 
 
-;; Copyright (C) 2000-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2016 Free Software Foundation, Inc.
 
 ;; Author: Colin Walters <walters@verbum.org>
 ;; Maintainer: John Paul Wallington <jpw@gnu.org>
 
 ;; Author: Colin Walters <walters@verbum.org>
 ;; Maintainer: John Paul Wallington <jpw@gnu.org>
@@ -53,6 +53,8 @@
 (defvar ibuffer-tmp-hide-regexps)
 (defvar ibuffer-tmp-show-regexps)
 
 (defvar ibuffer-tmp-hide-regexps)
 (defvar ibuffer-tmp-show-regexps)
 
+(declare-function ibuffer-ext-visible-p "ibuf-ext"
+                 (buf all &optional ibuffer-buf))
 (declare-function ibuffer-mark-on-buffer "ibuf-ext"
                  (func &optional ibuffer-mark-on-buffer-mark group))
 (declare-function ibuffer-generate-filter-groups "ibuf-ext"
 (declare-function ibuffer-mark-on-buffer "ibuf-ext"
                  (func &optional ibuffer-mark-on-buffer-mark group))
 (declare-function ibuffer-generate-filter-groups "ibuf-ext"
@@ -126,7 +128,7 @@ own!):
 Thus, if you wanted to use these two formats, the appropriate
 value for this variable would be
 
 Thus, if you wanted to use these two formats, the appropriate
 value for this variable would be
 
-  '((mark \" \" name)
+  \\='((mark \" \" name)
     (mark modified read-only
           (name 16 16 :left)
           (size 6 -1 :right)))
     (mark modified read-only
           (name 16 16 :left)
           (size 6 -1 :right)))
@@ -154,7 +156,7 @@ elisp byte-compiler."
             (null buffer-file-name))
        italic)
     (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face)
             (null buffer-file-name))
        italic)
     (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face)
-    (35 (eq major-mode 'dired-mode) font-lock-function-name-face))
+    (35 (derived-mode-p 'dired-mode) font-lock-function-name-face))
   "An alist describing how to fontify buffers.
 Each element should be of the form (PRIORITY FORM FACE), where
 PRIORITY is an integer, FORM is an arbitrary form to evaluate in the
   "An alist describing how to fontify buffers.
 Each element should be of the form (PRIORITY FORM FACE), where
 PRIORITY is an integer, FORM is an arbitrary form to evaluate in the
@@ -348,6 +350,7 @@ directory, like `default-directory'."
 (defcustom ibuffer-mode-hook nil
   "Hook run upon entry into `ibuffer-mode'."
   :type 'hook
 (defcustom ibuffer-mode-hook nil
   "Hook run upon entry into `ibuffer-mode'."
   :type 'hook
+  :options '(ibuffer-auto-mode)
   :group 'ibuffer)
 
 (defcustom ibuffer-load-hook nil
   :group 'ibuffer)
 
 (defcustom ibuffer-load-hook nil
@@ -462,6 +465,7 @@ directory, like `default-directory'."
     (define-key map (kbd "M-g") 'ibuffer-jump-to-buffer)
     (define-key map (kbd "M-s a C-s") 'ibuffer-do-isearch)
     (define-key map (kbd "M-s a M-C-s") 'ibuffer-do-isearch-regexp)
     (define-key map (kbd "M-g") 'ibuffer-jump-to-buffer)
     (define-key map (kbd "M-s a C-s") 'ibuffer-do-isearch)
     (define-key map (kbd "M-s a M-C-s") 'ibuffer-do-isearch-regexp)
+    (define-key map (kbd "M-s a C-o") 'ibuffer-do-occur)
     (define-key map (kbd "DEL") 'ibuffer-unmark-backward)
     (define-key map (kbd "M-DEL") 'ibuffer-unmark-all)
     (define-key map (kbd "* *") 'ibuffer-unmark-all)
     (define-key map (kbd "DEL") 'ibuffer-unmark-backward)
     (define-key map (kbd "M-DEL") 'ibuffer-unmark-all)
     (define-key map (kbd "* *") 'ibuffer-unmark-all)
@@ -536,10 +540,6 @@ directory, like `default-directory'."
     (define-key map (kbd "/ X") 'ibuffer-delete-saved-filter-groups)
     (define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups)
 
     (define-key map (kbd "/ X") 'ibuffer-delete-saved-filter-groups)
     (define-key map (kbd "/ \\") 'ibuffer-clear-filter-groups)
 
-    (define-key map (kbd "q") 'ibuffer-quit)
-    (define-key map (kbd "h") 'describe-mode)
-    (define-key map (kbd "?") 'describe-mode)
-
     (define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp)
     (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp)
     (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp)
     (define-key map (kbd "% n") 'ibuffer-mark-by-name-regexp)
     (define-key map (kbd "% m") 'ibuffer-mark-by-mode-regexp)
     (define-key map (kbd "% f") 'ibuffer-mark-by-file-name-regexp)
@@ -703,7 +703,8 @@ directory, like `default-directory'."
       '(menu-item "Diff with file" ibuffer-diff-with-file
         :help "View the differences between this buffer and its file"))
     (define-key-after map [menu-bar view auto-mode]
       '(menu-item "Diff with file" ibuffer-diff-with-file
         :help "View the differences between this buffer and its file"))
     (define-key-after map [menu-bar view auto-mode]
-      '(menu-item "Toggle Auto Mode" ibuffer-auto-mode
+      '(menu-item "Auto Mode" ibuffer-auto-mode
+        :button (:toggle . ibuffer-auto-mode)
         :help "Attempt to automatically update the Ibuffer buffer"))
     (define-key-after map [menu-bar view customize]
       '(menu-item "Customize Ibuffer" ibuffer-customize
         :help "Attempt to automatically update the Ibuffer buffer"))
     (define-key-after map [menu-bar view customize]
       '(menu-item "Customize Ibuffer" ibuffer-customize
@@ -873,12 +874,6 @@ directory, like `default-directory'."
     (define-key map [down-mouse-3] 'ibuffer-mouse-popup-menu)
     map))
 
     (define-key map [down-mouse-3] 'ibuffer-mouse-popup-menu)
     map))
 
-(defvar ibuffer-restore-window-config-on-quit nil
-  "If non-nil, restore previous window configuration upon exiting `ibuffer'.")
-
-(defvar ibuffer-prev-window-config nil
-  "Window configuration before starting Ibuffer.")
-
 (defvar ibuffer-did-modification nil)
 
 (defvar ibuffer-compiled-formats nil)
 (defvar ibuffer-did-modification nil)
 
 (defvar ibuffer-compiled-formats nil)
@@ -912,7 +907,7 @@ width and the longest string in LIST."
       (when (zerop columns)
        (setq columns 1))
       (while list
       (when (zerop columns)
        (setq columns 1))
       (while list
-       (dotimes (i (1- columns))
+       (dotimes (_ (1- columns))
          (insert (concat (car list) (make-string (- max (length (car list)))
                                                  ?\s)))
          (setq list (cdr list)))
          (insert (concat (car list) (make-string (- max (length (car list)))
                                                  ?\s)))
          (setq list (cdr list)))
@@ -1197,7 +1192,7 @@ a new window in the current frame, splitting vertically."
                             (and (stringp (cadr err))
                                  ;; This definitely falls in the
                                  ;; ghetto hack category...
                             (and (stringp (cadr err))
                                  ;; This definitely falls in the
                                  ;; ghetto hack category...
-                                 (not (string-match "too small" (cadr err)))))
+                                 (not (string-match-p "too small" (cadr err)))))
                         (signal (car err) (cdr err))
                       (enlarge-window 3))))))
              (select-window (next-window))
                         (signal (car err) (cdr err))
                       (enlarge-window 3))))))
              (select-window (next-window))
@@ -1280,7 +1275,7 @@ a new window in the current frame, splitting vertically."
    :modifier-p t)
   (set-buffer-modified-p (not (buffer-modified-p))))
 
    :modifier-p t)
   (set-buffer-modified-p (not (buffer-modified-p))))
 
-(define-ibuffer-op ibuffer-do-toggle-read-only (&optional arg)
+(define-ibuffer-op ibuffer-do-toggle-read-only (&optional _arg);FIXME:arg unused!
   "Toggle read only status in marked buffers.
 With optional ARG, make read-only only if ARG is not negative."
   (:opstring "toggled read only status in"
   "Toggle read only status in marked buffers.
 With optional ARG, make read-only only if ARG is not negative."
   (:opstring "toggled read only status in"
@@ -1359,23 +1354,36 @@ group."
     (message "%s buffers marked" count))
   (ibuffer-redisplay t))
 
     (message "%s buffers marked" count))
   (ibuffer-redisplay t))
 
-(defun ibuffer-mark-forward (arg)
-  "Mark the buffer on this line, and move forward ARG lines.
+(defsubst ibuffer-get-region-and-prefix ()
+  (let ((arg (prefix-numeric-value current-prefix-arg)))
+    (if (use-region-p) (list (region-beginning) (region-end) arg)
+      (list nil nil arg))))
+
+(defun ibuffer-mark-forward (start end arg)
+  "Mark the buffers in the region, or ARG buffers.
 If point is on a group name, this function operates on that group."
 If point is on a group name, this function operates on that group."
-  (interactive "p")
-  (ibuffer-mark-interactive arg ibuffer-marked-char))
+  (interactive (ibuffer-get-region-and-prefix))
+  (ibuffer-mark-region-or-n-with-char start end arg ibuffer-marked-char))
 
 
-(defun ibuffer-unmark-forward (arg)
-  "Unmark the buffer on this line, and move forward ARG lines.
+(defun ibuffer-unmark-forward (start end arg)
+  "Unmark the buffers in the region, or ARG buffers.
 If point is on a group name, this function operates on that group."
 If point is on a group name, this function operates on that group."
-  (interactive "p")
-  (ibuffer-mark-interactive arg ?\s))
+  (interactive (ibuffer-get-region-and-prefix))
+  (ibuffer-mark-region-or-n-with-char start end arg ?\s))
 
 (defun ibuffer-unmark-backward (arg)
 
 (defun ibuffer-unmark-backward (arg)
-  "Unmark the buffer on this line, and move backward ARG lines.
+  "Unmark the ARG previous buffers.
 If point is on a group name, this function operates on that group."
   (interactive "p")
 If point is on a group name, this function operates on that group."
   (interactive "p")
-  (ibuffer-unmark-forward (- arg)))
+  (ibuffer-unmark-forward nil nil (- arg)))
+
+(defun ibuffer-mark-region-or-n-with-char (start end arg mark-char)
+  (if (use-region-p)
+      (let ((cur (point)) (line-count (count-lines start end)))
+        (goto-char start)
+        (ibuffer-mark-interactive line-count mark-char)
+        (goto-char cur))
+      (ibuffer-mark-interactive arg mark-char)))
 
 (defun ibuffer-mark-interactive (arg mark &optional movement)
   (ibuffer-assert-ibuffer-mode)
 
 (defun ibuffer-mark-interactive (arg mark &optional movement)
   (ibuffer-assert-ibuffer-mode)
@@ -1414,16 +1422,16 @@ If point is on a group name, this function operates on that group."
                       (list (ibuffer-current-buffer)
                             mark))))
 
                       (list (ibuffer-current-buffer)
                             mark))))
 
-(defun ibuffer-mark-for-delete (arg)
-  "Mark the buffers on ARG lines forward for deletion.
+(defun ibuffer-mark-for-delete (start end arg)
+  "Mark for deletion the buffers in the region, or ARG buffers.
 If point is on a group name, this function operates on that group."
 If point is on a group name, this function operates on that group."
-  (interactive "P")
-  (ibuffer-mark-interactive arg ibuffer-deletion-char 1))
+  (interactive (ibuffer-get-region-and-prefix))
+  (ibuffer-mark-region-or-n-with-char start end arg ibuffer-deletion-char))
 
 (defun ibuffer-mark-for-delete-backwards (arg)
 
 (defun ibuffer-mark-for-delete-backwards (arg)
-  "Mark the buffers on ARG lines backward for deletion.
+  "Mark for deletion the ARG previous buffers.
 If point is on a group name, this function operates on that group."
 If point is on a group name, this function operates on that group."
-  (interactive "P")
+  (interactive "p")
   (ibuffer-mark-interactive arg ibuffer-deletion-char -1))
 
 (defun ibuffer-current-buffer (&optional must-be-live)
   (ibuffer-mark-interactive arg ibuffer-deletion-char -1))
 
 (defun ibuffer-current-buffer (&optional must-be-live)
@@ -1525,7 +1533,7 @@ If point is on a group name, this function operates on that group."
        ;; We use these variables to keep track of which variables
        ;; inside the generated function we need to bind, since
        ;; binding variables in Emacs takes time.
        ;; We use these variables to keep track of which variables
        ;; inside the generated function we need to bind, since
        ;; binding variables in Emacs takes time.
-       str-used tmp1-used tmp2-used global-strlen-used)
+       (vars-used ()))
     (dolist (form format)
       (push
        ;; Generate a form based on a particular format entry, like
     (dolist (form format)
       (push
        ;; Generate a form based on a particular format entry, like
@@ -1551,8 +1559,8 @@ If point is on a group name, this function operates on that group."
               ;; This is a complex case; they want it limited to a
               ;; minimum size.
               (setq min-used t)
               ;; This is a complex case; they want it limited to a
               ;; minimum size.
               (setq min-used t)
-              (setq str-used t strlen-used t global-strlen-used t
-                    tmp1-used t tmp2-used t)
+               (setq strlen-used t)
+              (setq vars-used '(str strlen tmp1 tmp2))
               ;; Generate code to limit the string to a minimum size.
               (setq minform `(progn
                                (setq str
               ;; Generate code to limit the string to a minimum size.
               (setq minform `(progn
                                (setq str
@@ -1564,7 +1572,8 @@ If point is on a group name, this function operates on that group."
                                            strlen)
                                        align)))))
             (when (or (not (integerp max)) (> max 0))
                                            strlen)
                                        align)))))
             (when (or (not (integerp max)) (> max 0))
-              (setq str-used t max-used t)
+              (setq max-used t)
+               (cl-pushnew 'str vars-used)
               ;; Generate code to limit the string to a maximum size.
               (setq maxform `(progn
                                (setq str
               ;; Generate code to limit the string to a maximum size.
               (setq maxform `(progn
                                (setq str
@@ -1592,8 +1601,9 @@ If point is on a group name, this function operates on that group."
                   ;; don't even understand it, and I wrote it five
                   ;; minutes ago.
                   (insertgenfn
                   ;; don't even understand it, and I wrote it five
                   ;; minutes ago.
                   (insertgenfn
-                    (ibuffer-aif (get sym 'ibuffer-column-summarizer)
+                    (if (get sym 'ibuffer-column-summarizer)
                         ;; I really, really wish Emacs Lisp had closures.
                         ;; I really, really wish Emacs Lisp had closures.
+                        ;; FIXME: Elisp does have them now.
                         (lambda (arg sym)
                           `(insert
                             (let ((ret ,arg))
                         (lambda (arg sym)
                           `(insert
                             (let ((ret ,arg))
@@ -1601,7 +1611,7 @@ If point is on a group name, this function operates on that group."
                                    (cons ret (get ',sym
                                                   'ibuffer-column-summary)))
                               ret)))
                                    (cons ret (get ',sym
                                                   'ibuffer-column-summary)))
                               ret)))
-                      (lambda (arg sym)
+                      (lambda (arg _sym)
                         `(insert ,arg))))
                   (mincompform `(< strlen ,(if (integerp min)
                                                min
                         `(insert ,arg))))
                   (mincompform `(< strlen ,(if (integerp min)
                                                min
@@ -1629,10 +1639,9 @@ If point is on a group name, this function operates on that group."
                          `(when ,maxcompform
                             ,maxform)))
                      outforms)
                          `(when ,maxcompform
                             ,maxform)))
                      outforms)
-                    (push (append
-                           `(setq str ,callform)
-                           (when strlen-used
-                             `(strlen (length str))))
+                    (push `(setq str ,callform
+                                  ,@(when strlen-used
+                                      `(strlen (length str))))
                           outforms)
                     (setq outforms
                           (append outforms
                           outforms)
                     (setq outforms
                           (append outforms
@@ -1645,25 +1654,17 @@ If point is on a group name, this function operates on that group."
               `(let ,letbindings
                  ,@outforms)))))
        result))
               `(let ,letbindings
                  ,@outforms)))))
        result))
-    (setq result
-         ;; We don't want to unconditionally load the byte-compiler.
-         (funcall (if (or ibuffer-always-compile-formats
-                          (featurep 'bytecomp))
-                      #'byte-compile
-                    #'identity)
-                  ;; Here, we actually create a lambda form which
-                  ;; inserts all the generated forms for each entry
-                  ;; in the format string.
-                  (nconc (list 'lambda '(buffer mark))
-                         `((let ,(append (when str-used
-                                           '(str))
-                                         (when global-strlen-used
-                                           '(strlen))
-                                         (when tmp1-used
-                                           '(tmp1))
-                                         (when tmp2-used
-                                           '(tmp2)))
-                             ,@(nreverse result))))))))
+    ;; We don't want to unconditionally load the byte-compiler.
+    (funcall (if (or ibuffer-always-compile-formats
+                     (featurep 'bytecomp))
+                 #'byte-compile
+               #'identity)
+             ;; Here, we actually create a lambda form which
+             ;; inserts all the generated forms for each entry
+             ;; in the format string.
+             `(lambda (buffer mark)
+                (let ,vars-used
+                  ,@(nreverse result))))))
 
 (defun ibuffer-recompile-formats ()
   "Recompile `ibuffer-formats'."
 
 (defun ibuffer-recompile-formats ()
   "Recompile `ibuffer-formats'."
@@ -1681,8 +1682,8 @@ If point is on a group name, this function operates on that group."
 
 (defun ibuffer-clear-summary-columns (format)
   (dolist (form format)
 
 (defun ibuffer-clear-summary-columns (format)
   (dolist (form format)
-    (ibuffer-awhen (and (consp form)
-                       (get (car form) 'ibuffer-column-summarizer))
+    (when (and (consp form)
+               (get (car form) 'ibuffer-column-summarizer))
       (put (car form) 'ibuffer-column-summary nil))))
 
 (defun ibuffer-check-formats ()
       (put (car form) 'ibuffer-column-summary nil))))
 
 (defun ibuffer-check-formats ()
@@ -1797,7 +1798,7 @@ If point is on a group name, this function operates on that group."
      (let ((procs 0)
           (files 0))
        (dolist (string strings)
      (let ((procs 0)
           (files 0))
        (dolist (string strings)
-        (if (string-match "\\(\?:\\`(\[\[:ascii:\]\]\+)\\)" string)
+        (if (string-match "\\(?:\\`([[:ascii:]]+)\\)" string)
             (progn (setq procs (1+ procs))
                    (if (< (match-end 0) (length string))
                        (setq files (1+ files))))
             (progn (setq procs (1+ procs))
                    (if (< (match-end 0) (length string))
                        (setq files (1+ files))))
@@ -1920,9 +1921,9 @@ the buffer object itself and the current mark symbol."
                     ;; Kill the line if the buffer is dead
                     'kill)))
              ;; A given mapping function should return:
                     ;; Kill the line if the buffer is dead
                     'kill)))
              ;; A given mapping function should return:
-             ;; `nil' if it chose not to affect the buffer
+             ;; nil if it chose not to affect the buffer
              ;; `kill' means the remove line from the buffer list
              ;; `kill' means the remove line from the buffer list
-             ;; `t' otherwise
+             ;; t otherwise
              (cl-incf ibuffer-map-lines-total)
              (cond ((null result)
                     (forward-line 1))
              (cl-incf ibuffer-map-lines-total)
              (cond ((null result)
                     (forward-line 1))
@@ -2049,7 +2050,7 @@ the value of point at the beginning of the line for that buffer."
 (defun ibuffer-update-title-and-summary (format)
   (ibuffer-assert-ibuffer-mode)
   ;; Don't do funky font-lock stuff here
 (defun ibuffer-update-title-and-summary (format)
   (ibuffer-assert-ibuffer-mode)
   ;; Don't do funky font-lock stuff here
-  (let ((after-change-functions nil))
+  (let ((inhibit-modification-hooks t))
     (if (get-text-property (point-min) 'ibuffer-title)
        (delete-region (point-min)
                       (next-single-property-change
     (if (get-text-property (point-min) 'ibuffer-title)
        (delete-region (point-min)
                       (next-single-property-change
@@ -2174,7 +2175,7 @@ If optional arg SILENT is non-nil, do not display progress messages."
                      (eq ibuffer-always-show-last-buffer
                          :nomini)
                      (minibufferp (cadr bufs)))
                      (eq ibuffer-always-show-last-buffer
                          :nomini)
                      (minibufferp (cadr bufs)))
-                    (cl-caddr bufs)
+                    (nth 2 bufs)
                   (cadr bufs))
                 (ibuffer-current-buffers-with-marks bufs)
                 ibuffer-display-maybe-show-predicates)))
                   (cadr bufs))
                 (ibuffer-current-buffers-with-marks bufs)
                 ibuffer-display-maybe-show-predicates)))
@@ -2206,7 +2207,7 @@ If optional arg SILENT is non-nil, do not display progress messages."
     (require 'ibuf-ext))
   (let* ((sortdat (assq ibuffer-sorting-mode
                        ibuffer-sorting-functions-alist))
     (require 'ibuf-ext))
   (let* ((sortdat (assq ibuffer-sorting-mode
                        ibuffer-sorting-functions-alist))
-        (func (cl-caddr sortdat)))
+        (func (nth 2 sortdat)))
     (let ((result
           ;; actually sort the buffers
           (if (and sortdat func)
     (let ((result
           ;; actually sort the buffers
           (if (and sortdat func)
@@ -2256,7 +2257,7 @@ If optional arg SILENT is non-nil, do not display progress messages."
         (orig (count-lines (point-min) (point)))
         ;; Inhibit font-lock caching tricks, since we're modifying the
         ;; entire buffer at once
         (orig (count-lines (point-min) (point)))
         ;; Inhibit font-lock caching tricks, since we're modifying the
         ;; entire buffer at once
-        (after-change-functions nil)
+        (inhibit-modification-hooks t)
         (ext-loaded (featurep 'ibuf-ext))
         (bgroups (if ext-loaded
                      (ibuffer-generate-filter-groups bmarklist)
         (ext-loaded (featurep 'ibuf-ext))
         (bgroups (if ext-loaded
                      (ibuffer-generate-filter-groups bmarklist)
@@ -2293,18 +2294,6 @@ If optional arg SILENT is non-nil, do not display progress messages."
       (goto-char (point-min))
       (forward-line orig))))
 
       (goto-char (point-min))
       (forward-line orig))))
 
-(defun ibuffer-quit ()
-  "Quit this `ibuffer' session.
-Try to restore the previous window configuration if
-`ibuffer-restore-window-config-on-quit' is non-nil."
-  (interactive)
-  (if ibuffer-restore-window-config-on-quit
-      (progn
-       (bury-buffer)
-       (unless (= (count-windows) 1)
-         (set-window-configuration ibuffer-prev-window-config)))
-    (bury-buffer)))
-
 ;;;###autoload
 (defun ibuffer-list-buffers (&optional files-only)
   "Display a list of buffers, in another window.
 ;;;###autoload
 (defun ibuffer-list-buffers (&optional files-only)
   "Display a list of buffers, in another window.
@@ -2327,7 +2316,7 @@ buffers which are visiting a file."
 (defun ibuffer (&optional other-window-p name qualifiers noselect
                          shrink filter-groups formats)
   "Begin using Ibuffer to edit a list of buffers.
 (defun ibuffer (&optional other-window-p name qualifiers noselect
                          shrink filter-groups formats)
   "Begin using Ibuffer to edit a list of buffers.
-Type 'h' after entering ibuffer for more information.
+Type `h' after entering ibuffer for more information.
 
 All arguments are optional.
 OTHER-WINDOW-P says to use another window.
 
 All arguments are optional.
 OTHER-WINDOW-P says to use another window.
@@ -2345,7 +2334,6 @@ FORMATS is the value to use for `ibuffer-formats'.
   (interactive "P")
   (when ibuffer-use-other-window
     (setq other-window-p t))
   (interactive "P")
   (when ibuffer-use-other-window
     (setq other-window-p t))
-  (setq ibuffer-prev-window-config (current-window-configuration))
   (let ((buf (get-buffer-create (or name "*Ibuffer*"))))
     (if other-window-p
        (funcall (if noselect (lambda (buf) (display-buffer buf t)) #'pop-to-buffer) buf)
   (let ((buf (get-buffer-create (or name "*Ibuffer*"))))
     (if other-window-p
        (funcall (if noselect (lambda (buf) (display-buffer buf t)) #'pop-to-buffer) buf)
@@ -2355,10 +2343,9 @@ FORMATS is the value to use for `ibuffer-formats'.
        ;; We switch to the buffer's window in order to be able
        ;; to modify the value of point
        (select-window (get-buffer-window buf 0))
        ;; We switch to the buffer's window in order to be able
        ;; to modify the value of point
        (select-window (get-buffer-window buf 0))
-       (or (eq major-mode 'ibuffer-mode)
+       (or (derived-mode-p 'ibuffer-mode)
            (ibuffer-mode))
            (ibuffer-mode))
-       (setq ibuffer-restore-window-config-on-quit other-window-p)
-       (when shrink
+       (when shrink
          (setq ibuffer-shrink-to-minimum-size shrink))
        (when qualifiers
          (require 'ibuf-ext)
          (setq ibuffer-shrink-to-minimum-size shrink))
        (when qualifiers
          (require 'ibuf-ext)
@@ -2380,7 +2367,7 @@ FORMATS is the value to use for `ibuffer-formats'.
          (message "Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help"))))))
 
 (put 'ibuffer-mode 'mode-class 'special)
          (message "Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help"))))))
 
 (put 'ibuffer-mode 'mode-class 'special)
-(defun ibuffer-mode ()
+(define-derived-mode ibuffer-mode special-mode "IBuffer"
   "A major mode for viewing a list of buffers.
 In Ibuffer, you can conveniently perform many operations on the
 currently open buffers, in addition to filtering your view to a
   "A major mode for viewing a list of buffers.
 In Ibuffer, you can conveniently perform many operations on the
 currently open buffers, in addition to filtering your view to a
@@ -2388,123 +2375,122 @@ particular subset of them, and sorting by various criteria.
 
 Operations on marked buffers:
 \\<ibuffer-mode-map>
 
 Operations on marked buffers:
 \\<ibuffer-mode-map>
-  '\\[ibuffer-do-save]' - Save the marked buffers
-  '\\[ibuffer-do-view]' - View the marked buffers in this frame.
-  '\\[ibuffer-do-view-other-frame]' - View the marked buffers in another frame.
-  '\\[ibuffer-do-revert]' - Revert the marked buffers.
-  '\\[ibuffer-do-toggle-read-only]' - Toggle read-only state of marked buffers.
-  '\\[ibuffer-do-delete]' - Kill the marked buffers.
-  '\\[ibuffer-do-isearch]' - Do incremental search in the marked buffers.
-  '\\[ibuffer-do-isearch-regexp]' - Isearch for regexp in the marked buffers.
-  '\\[ibuffer-do-replace-regexp]' - Replace by regexp in each of the marked
+  `\\[ibuffer-do-save]' - Save the marked buffers
+  `\\[ibuffer-do-view]' - View the marked buffers in this frame.
+  `\\[ibuffer-do-view-other-frame]' - View the marked buffers in another frame.
+  `\\[ibuffer-do-revert]' - Revert the marked buffers.
+  `\\[ibuffer-do-toggle-read-only]' - Toggle read-only state of marked buffers.
+  `\\[ibuffer-do-delete]' - Kill the marked buffers.
+  `\\[ibuffer-do-isearch]' - Do incremental search in the marked buffers.
+  `\\[ibuffer-do-isearch-regexp]' - Isearch for regexp in the marked buffers.
+  `\\[ibuffer-do-replace-regexp]' - Replace by regexp in each of the marked
           buffers.
           buffers.
-  '\\[ibuffer-do-query-replace]' - Query replace in each of the marked buffers.
-  '\\[ibuffer-do-query-replace-regexp]' - As above, with a regular expression.
-  '\\[ibuffer-do-print]' - Print the marked buffers.
-  '\\[ibuffer-do-occur]' - List lines in all marked buffers which match
+  `\\[ibuffer-do-query-replace]' - Query replace in each of the marked buffers.
+  `\\[ibuffer-do-query-replace-regexp]' - As above, with a regular expression.
+  `\\[ibuffer-do-print]' - Print the marked buffers.
+  `\\[ibuffer-do-occur]' - List lines in all marked buffers which match
           a given regexp (like the function `occur').
           a given regexp (like the function `occur').
-  '\\[ibuffer-do-shell-command-pipe]' - Pipe the contents of the marked
+  `\\[ibuffer-do-shell-command-pipe]' - Pipe the contents of the marked
           buffers to a shell command.
           buffers to a shell command.
-  '\\[ibuffer-do-shell-command-pipe-replace]' - Replace the contents of the marked
+  `\\[ibuffer-do-shell-command-pipe-replace]' - Replace the contents of the marked
           buffers with the output of a shell command.
           buffers with the output of a shell command.
-  '\\[ibuffer-do-shell-command-file]' - Run a shell command with the
+  `\\[ibuffer-do-shell-command-file]' - Run a shell command with the
           buffer's file as an argument.
           buffer's file as an argument.
-  '\\[ibuffer-do-eval]' - Evaluate a form in each of the marked buffers.  This
+  `\\[ibuffer-do-eval]' - Evaluate a form in each of the marked buffers.  This
           is a very flexible command.  For example, if you want to make all
           of the marked buffers read only, try using (read-only-mode 1) as
           the input form.
           is a very flexible command.  For example, if you want to make all
           of the marked buffers read only, try using (read-only-mode 1) as
           the input form.
-  '\\[ibuffer-do-view-and-eval]' - As above, but view each buffer while the form
+  `\\[ibuffer-do-view-and-eval]' - As above, but view each buffer while the form
           is evaluated.
           is evaluated.
-  '\\[ibuffer-do-kill-lines]' - Remove the marked lines from the *Ibuffer* buffer,
+  `\\[ibuffer-do-kill-lines]' - Remove the marked lines from the *Ibuffer* buffer,
           but don't kill the associated buffer.
           but don't kill the associated buffer.
-  '\\[ibuffer-do-kill-on-deletion-marks]' - Kill all buffers marked for deletion.
+  `\\[ibuffer-do-kill-on-deletion-marks]' - Kill all buffers marked for deletion.
 
 Marking commands:
 
 
 Marking commands:
 
-  '\\[ibuffer-mark-forward]' - Mark the buffer at point.
-  '\\[ibuffer-toggle-marks]' - Unmark all currently marked buffers, and mark
+  `\\[ibuffer-mark-forward]' - Mark the buffer at point.
+  `\\[ibuffer-toggle-marks]' - Unmark all currently marked buffers, and mark
           all unmarked buffers.
           all unmarked buffers.
-  '\\[ibuffer-unmark-forward]' - Unmark the buffer at point.
-  '\\[ibuffer-unmark-backward]' - Unmark the buffer at point, and move to the
+  `\\[ibuffer-unmark-forward]' - Unmark the buffer at point.
+  `\\[ibuffer-unmark-backward]' - Unmark the buffer at point, and move to the
           previous line.
           previous line.
-  '\\[ibuffer-unmark-all]' - Unmark all marked buffers.
-  '\\[ibuffer-mark-by-mode]' - Mark buffers by major mode.
-  '\\[ibuffer-mark-unsaved-buffers]' - Mark all \"unsaved\" buffers.
+  `\\[ibuffer-unmark-all]' - Unmark all marked buffers.
+  `\\[ibuffer-mark-by-mode]' - Mark buffers by major mode.
+  `\\[ibuffer-mark-unsaved-buffers]' - Mark all \"unsaved\" buffers.
           This means that the buffer is modified, and has an associated file.
           This means that the buffer is modified, and has an associated file.
-  '\\[ibuffer-mark-modified-buffers]' - Mark all modified buffers,
+  `\\[ibuffer-mark-modified-buffers]' - Mark all modified buffers,
           regardless of whether or not they have an associated file.
           regardless of whether or not they have an associated file.
-  '\\[ibuffer-mark-special-buffers]' - Mark all buffers whose name begins and
-          ends with '*'.
-  '\\[ibuffer-mark-dissociated-buffers]' - Mark all buffers which have
+  `\\[ibuffer-mark-special-buffers]' - Mark all buffers whose name begins and
+          ends with `*'.
+  `\\[ibuffer-mark-dissociated-buffers]' - Mark all buffers which have
           an associated file, but that file doesn't currently exist.
           an associated file, but that file doesn't currently exist.
-  '\\[ibuffer-mark-read-only-buffers]' - Mark all read-only buffers.
-  '\\[ibuffer-mark-dired-buffers]' - Mark buffers in `dired' mode.
-  '\\[ibuffer-mark-help-buffers]' - Mark buffers in `help-mode', `apropos-mode', etc.
-  '\\[ibuffer-mark-old-buffers]' - Mark buffers older than `ibuffer-old-time'.
-  '\\[ibuffer-mark-for-delete]' - Mark the buffer at point for deletion.
-  '\\[ibuffer-mark-by-name-regexp]' - Mark buffers by their name, using a regexp.
-  '\\[ibuffer-mark-by-mode-regexp]' - Mark buffers by their major mode, using a regexp.
-  '\\[ibuffer-mark-by-file-name-regexp]' - Mark buffers by their filename, using a regexp.
+  `\\[ibuffer-mark-read-only-buffers]' - Mark all read-only buffers.
+  `\\[ibuffer-mark-dired-buffers]' - Mark buffers in `dired' mode.
+  `\\[ibuffer-mark-help-buffers]' - Mark buffers in `help-mode', `apropos-mode', etc.
+  `\\[ibuffer-mark-old-buffers]' - Mark buffers older than `ibuffer-old-time'.
+  `\\[ibuffer-mark-for-delete]' - Mark the buffer at point for deletion.
+  `\\[ibuffer-mark-by-name-regexp]' - Mark buffers by their name, using a regexp.
+  `\\[ibuffer-mark-by-mode-regexp]' - Mark buffers by their major mode, using a regexp.
+  `\\[ibuffer-mark-by-file-name-regexp]' - Mark buffers by their filename, using a regexp.
 
 Filtering commands:
 
 
 Filtering commands:
 
-  '\\[ibuffer-filter-by-mode]' - Add a filter by any major mode.
-  '\\[ibuffer-filter-by-used-mode]' - Add a filter by a major mode now in use.
-  '\\[ibuffer-filter-by-derived-mode]' - Add a filter by derived mode.
-  '\\[ibuffer-filter-by-name]' - Add a filter by buffer name.
-  '\\[ibuffer-filter-by-content]' - Add a filter by buffer content.
-  '\\[ibuffer-filter-by-filename]' - Add a filter by filename.
-  '\\[ibuffer-filter-by-size-gt]' - Add a filter by buffer size.
-  '\\[ibuffer-filter-by-size-lt]' - Add a filter by buffer size.
-  '\\[ibuffer-filter-by-predicate]' - Add a filter by an arbitrary Lisp predicate.
-  '\\[ibuffer-save-filters]' - Save the current filters with a name.
-  '\\[ibuffer-switch-to-saved-filters]' - Switch to previously saved filters.
-  '\\[ibuffer-add-saved-filters]' - Add saved filters to current filters.
-  '\\[ibuffer-or-filter]' - Replace the top two filters with their logical OR.
-  '\\[ibuffer-pop-filter]' - Remove the top filter.
-  '\\[ibuffer-negate-filter]' - Invert the logical sense of the top filter.
-  '\\[ibuffer-decompose-filter]' - Break down the topmost filter.
-  '\\[ibuffer-filter-disable]' - Remove all filtering currently in effect.
+  `\\[ibuffer-filter-by-mode]' - Add a filter by any major mode.
+  `\\[ibuffer-filter-by-used-mode]' - Add a filter by a major mode now in use.
+  `\\[ibuffer-filter-by-derived-mode]' - Add a filter by derived mode.
+  `\\[ibuffer-filter-by-name]' - Add a filter by buffer name.
+  `\\[ibuffer-filter-by-content]' - Add a filter by buffer content.
+  `\\[ibuffer-filter-by-filename]' - Add a filter by filename.
+  `\\[ibuffer-filter-by-size-gt]' - Add a filter by buffer size.
+  `\\[ibuffer-filter-by-size-lt]' - Add a filter by buffer size.
+  `\\[ibuffer-filter-by-predicate]' - Add a filter by an arbitrary Lisp predicate.
+  `\\[ibuffer-save-filters]' - Save the current filters with a name.
+  `\\[ibuffer-switch-to-saved-filters]' - Switch to previously saved filters.
+  `\\[ibuffer-add-saved-filters]' - Add saved filters to current filters.
+  `\\[ibuffer-or-filter]' - Replace the top two filters with their logical OR.
+  `\\[ibuffer-pop-filter]' - Remove the top filter.
+  `\\[ibuffer-negate-filter]' - Invert the logical sense of the top filter.
+  `\\[ibuffer-decompose-filter]' - Break down the topmost filter.
+  `\\[ibuffer-filter-disable]' - Remove all filtering currently in effect.
 
 Filter group commands:
 
 
 Filter group commands:
 
-  '\\[ibuffer-filters-to-filter-group]' - Create filter group from filters.
-  '\\[ibuffer-pop-filter-group]' - Remove top filter group.
-  '\\[ibuffer-forward-filter-group]' - Move to the next filter group.
-  '\\[ibuffer-backward-filter-group]' - Move to the previous filter group.
-  '\\[ibuffer-clear-filter-groups]' - Remove all active filter groups.
-  '\\[ibuffer-save-filter-groups]' - Save the current groups with a name.
-  '\\[ibuffer-switch-to-saved-filter-groups]' - Restore previously saved groups.
-  '\\[ibuffer-delete-saved-filter-groups]' - Delete previously saved groups.
+  `\\[ibuffer-filters-to-filter-group]' - Create filter group from filters.
+  `\\[ibuffer-pop-filter-group]' - Remove top filter group.
+  `\\[ibuffer-forward-filter-group]' - Move to the next filter group.
+  `\\[ibuffer-backward-filter-group]' - Move to the previous filter group.
+  `\\[ibuffer-clear-filter-groups]' - Remove all active filter groups.
+  `\\[ibuffer-save-filter-groups]' - Save the current groups with a name.
+  `\\[ibuffer-switch-to-saved-filter-groups]' - Restore previously saved groups.
+  `\\[ibuffer-delete-saved-filter-groups]' - Delete previously saved groups.
 
 Sorting commands:
 
 
 Sorting commands:
 
-  '\\[ibuffer-toggle-sorting-mode]' - Rotate between the various sorting modes.
-  '\\[ibuffer-invert-sorting]' - Reverse the current sorting order.
-  '\\[ibuffer-do-sort-by-alphabetic]' - Sort the buffers lexicographically.
-  '\\[ibuffer-do-sort-by-filename/process]' - Sort the buffers by the file name.
-  '\\[ibuffer-do-sort-by-recency]' - Sort the buffers by last viewing time.
-  '\\[ibuffer-do-sort-by-size]' - Sort the buffers by size.
-  '\\[ibuffer-do-sort-by-major-mode]' - Sort the buffers by major mode.
+  `\\[ibuffer-toggle-sorting-mode]' - Rotate between the various sorting modes.
+  `\\[ibuffer-invert-sorting]' - Reverse the current sorting order.
+  `\\[ibuffer-do-sort-by-alphabetic]' - Sort the buffers lexicographically.
+  `\\[ibuffer-do-sort-by-filename/process]' - Sort the buffers by the file name.
+  `\\[ibuffer-do-sort-by-recency]' - Sort the buffers by last viewing time.
+  `\\[ibuffer-do-sort-by-size]' - Sort the buffers by size.
+  `\\[ibuffer-do-sort-by-major-mode]' - Sort the buffers by major mode.
 
 Other commands:
 
 
 Other commands:
 
-  '\\[ibuffer-update]' - Regenerate the list of all buffers.
+  `\\[ibuffer-update]' - Regenerate the list of all buffers.
           Prefix arg means to toggle whether buffers that match
           `ibuffer-maybe-show-predicates' should be displayed.
 
           Prefix arg means to toggle whether buffers that match
           `ibuffer-maybe-show-predicates' should be displayed.
 
-  '\\[ibuffer-switch-format]' - Change the current display format.
-  '\\[forward-line]' - Move point to the next line.
-  '\\[previous-line]' - Move point to the previous line.
-  '\\[ibuffer-quit]' - Bury the Ibuffer buffer.
-  '\\[describe-mode]' - This help.
-  '\\[ibuffer-diff-with-file]' - View the differences between this buffer
+  `\\[ibuffer-switch-format]' - Change the current display format.
+  `\\[forward-line]' - Move point to the next line.
+  `\\[previous-line]' - Move point to the previous line.
+  `\\[describe-mode]' - This help.
+  `\\[ibuffer-diff-with-file]' - View the differences between this buffer
           and its associated file.
           and its associated file.
-  '\\[ibuffer-visit-buffer]' - View the buffer on this line.
-  '\\[ibuffer-visit-buffer-other-window]' - As above, but in another window.
-  '\\[ibuffer-visit-buffer-other-window-noselect]' - As both above, but don't select
+  `\\[ibuffer-visit-buffer]' - View the buffer on this line.
+  `\\[ibuffer-visit-buffer-other-window]' - As above, but in another window.
+  `\\[ibuffer-visit-buffer-other-window-noselect]' - As both above, but don't select
           the new window.
           the new window.
-  '\\[ibuffer-bury-buffer]' - Bury (not kill!) the buffer on this line.
+  `\\[ibuffer-bury-buffer]' - Bury (not kill!) the buffer on this line.
 
 ** Information on Filtering:
 
 
 ** Information on Filtering:
 
@@ -2512,7 +2498,7 @@ Other commands:
 buffer has its own stack of active filters.  For example, suppose you
 are working on an Emacs Lisp project.  You can create an Ibuffer
 buffer displays buffers in just `emacs-lisp' modes via
 buffer has its own stack of active filters.  For example, suppose you
 are working on an Emacs Lisp project.  You can create an Ibuffer
 buffer displays buffers in just `emacs-lisp' modes via
-'\\[ibuffer-filter-by-mode] emacs-lisp-mode RET'.  In this case, there
+`\\[ibuffer-filter-by-mode] emacs-lisp-mode RET'.  In this case, there
 is just one entry on the filtering stack.
 
 You can also combine filters.  The various filtering commands push a
 is just one entry on the filtering stack.
 
 You can also combine filters.  The various filtering commands push a
@@ -2520,21 +2506,24 @@ new filter onto the stack, and the filters combine to show just
 buffers which satisfy ALL criteria on the stack.  For example, suppose
 you only want to see buffers in `emacs-lisp' mode, whose names begin
 with \"gnus\".  You can accomplish this via:
 buffers which satisfy ALL criteria on the stack.  For example, suppose
 you only want to see buffers in `emacs-lisp' mode, whose names begin
 with \"gnus\".  You can accomplish this via:
-'\\[ibuffer-filter-by-mode] emacs-lisp-mode RET
-\\[ibuffer-filter-by-name] ^gnus RET'.
+
+  \\[ibuffer-filter-by-mode] emacs-lisp-mode RET
+  \\[ibuffer-filter-by-name] ^gnus RET
 
 Additionally, you can OR the top two filters together with
 
 Additionally, you can OR the top two filters together with
-'\\[ibuffer-or-filters]'.  To see all buffers in either
+`\\[ibuffer-or-filters]'.  To see all buffers in either
 `emacs-lisp-mode' or `lisp-interaction-mode', type:
 
 `emacs-lisp-mode' or `lisp-interaction-mode', type:
 
-'\\[ibuffer-filter-by-mode] emacs-lisp-mode RET \\[ibuffer-filter-by-mode] lisp-interaction-mode RET \\[ibuffer-or-filters]'.
+  \\[ibuffer-filter-by-mode] emacs-lisp-mode RET
+  \\[ibuffer-filter-by-mode] lisp-interaction-mode RET
+  \\[ibuffer-or-filters]
 
 Filters can also be saved and restored using mnemonic names: see the
 functions `ibuffer-save-filters' and `ibuffer-switch-to-saved-filters'.
 
 
 Filters can also be saved and restored using mnemonic names: see the
 functions `ibuffer-save-filters' and `ibuffer-switch-to-saved-filters'.
 
-To remove the top filter on the stack, use '\\[ibuffer-pop-filter]', and
+To remove the top filter on the stack, use `\\[ibuffer-pop-filter]', and
 to disable all filtering currently in effect, use
 to disable all filtering currently in effect, use
-'\\[ibuffer-filter-disable]'.
+`\\[ibuffer-filter-disable]'.
 
 ** Filter Groups:
 
 
 ** Filter Groups:
 
@@ -2542,12 +2531,13 @@ Once one has mastered filters, the next logical step up is \"filter
 groups\".  A filter group is basically a named group of buffers which
 match a filter, which are displayed together in an Ibuffer buffer.  To
 create a filter group, simply use the regular functions to create a
 groups\".  A filter group is basically a named group of buffers which
 match a filter, which are displayed together in an Ibuffer buffer.  To
 create a filter group, simply use the regular functions to create a
-filter, and then type '\\[ibuffer-filters-to-filter-group]'.
+filter, and then type `\\[ibuffer-filters-to-filter-group]'.
 
 A quick example will make things clearer.  Suppose that one wants to
 
 A quick example will make things clearer.  Suppose that one wants to
-group all of one's Emacs Lisp buffers together.  To do this, type
+group all of one's Emacs Lisp buffers together.  To do this, type:
 
 
-'\\[ibuffer-filter-by-mode] emacs-lisp-mode RET \\[ibuffer-filters-to-filter-group] RET emacs lisp buffers RET'
+  \\[ibuffer-filter-by-mode] emacs-lisp-mode RET
+  \\[ibuffer-filters-to-filter-group] emacs lisp buffers RET
 
 You may, of course, name the group whatever you want; it doesn't have
 to be \"emacs lisp buffers\".  Filter groups may be composed of any
 
 You may, of course, name the group whatever you want; it doesn't have
 to be \"emacs lisp buffers\".  Filter groups may be composed of any
@@ -2559,12 +2549,8 @@ multiple filter groups; instead, the first filter group is used.  The
 filter groups are displayed in this order of precedence.
 
 You may rearrange filter groups by using the regular
 filter groups are displayed in this order of precedence.
 
 You may rearrange filter groups by using the regular
-'\\[ibuffer-kill-line]' and '\\[ibuffer-yank]' pair.  Yanked groups
+`\\[ibuffer-kill-line]' and `\\[ibuffer-yank]' pair.  Yanked groups
 will be inserted before the group at point."
 will be inserted before the group at point."
-  (kill-all-local-variables)
-  (use-local-map ibuffer-mode-map)
-  (setq major-mode 'ibuffer-mode)
-  (setq mode-name "Ibuffer")
   ;; Include state info next to the mode name.
   (set (make-local-variable 'mode-line-process)
         '(" by "
   ;; Include state info next to the mode name.
   (set (make-local-variable 'mode-line-process)
         '(" by "
@@ -2615,7 +2601,6 @@ will be inserted before the group at point."
   (set (make-local-variable 'ibuffer-cached-eliding-string) nil)
   (set (make-local-variable 'ibuffer-cached-elide-long-columns) nil)
   (set (make-local-variable 'ibuffer-current-format) nil)
   (set (make-local-variable 'ibuffer-cached-eliding-string) nil)
   (set (make-local-variable 'ibuffer-cached-elide-long-columns) nil)
   (set (make-local-variable 'ibuffer-current-format) nil)
-  (set (make-local-variable 'ibuffer-restore-window-config-on-quit) nil)
   (set (make-local-variable 'ibuffer-did-modification) nil)
   (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil)
   (set (make-local-variable 'ibuffer-tmp-show-regexps) nil)
   (set (make-local-variable 'ibuffer-did-modification) nil)
   (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil)
   (set (make-local-variable 'ibuffer-tmp-show-regexps) nil)
@@ -2624,35 +2609,12 @@ will be inserted before the group at point."
   (ibuffer-update-format)
   (when ibuffer-default-directory
     (setq default-directory ibuffer-default-directory))
   (ibuffer-update-format)
   (when ibuffer-default-directory
     (setq default-directory ibuffer-default-directory))
-  (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
-  (run-mode-hooks 'ibuffer-mode-hook))
+  (add-hook 'change-major-mode-hook 'font-lock-defontify nil t))
 
 \f
 ;;; Start of automatically extracted autoloads.
 \f
 
 \f
 ;;; Start of automatically extracted autoloads.
 \f
-;;;### (autoloads (ibuffer-do-occur ibuffer-mark-dired-buffers ibuffer-mark-read-only-buffers
-;;;;;;  ibuffer-mark-special-buffers ibuffer-mark-old-buffers ibuffer-mark-compressed-file-buffers
-;;;;;;  ibuffer-mark-help-buffers ibuffer-mark-dissociated-buffers
-;;;;;;  ibuffer-mark-unsaved-buffers ibuffer-mark-modified-buffers
-;;;;;;  ibuffer-mark-by-mode ibuffer-mark-by-file-name-regexp ibuffer-mark-by-mode-regexp
-;;;;;;  ibuffer-mark-by-name-regexp ibuffer-copy-filename-as-kill
-;;;;;;  ibuffer-diff-with-file ibuffer-jump-to-buffer ibuffer-do-kill-lines
-;;;;;;  ibuffer-backwards-next-marked ibuffer-forward-next-marked
-;;;;;;  ibuffer-add-to-tmp-show ibuffer-add-to-tmp-hide ibuffer-bs-show
-;;;;;;  ibuffer-invert-sorting ibuffer-toggle-sorting-mode ibuffer-switch-to-saved-filters
-;;;;;;  ibuffer-add-saved-filters ibuffer-delete-saved-filters ibuffer-save-filters
-;;;;;;  ibuffer-or-filter ibuffer-negate-filter ibuffer-exchange-filters
-;;;;;;  ibuffer-decompose-filter ibuffer-pop-filter ibuffer-filter-disable
-;;;;;;  ibuffer-switch-to-saved-filter-groups ibuffer-delete-saved-filter-groups
-;;;;;;  ibuffer-save-filter-groups ibuffer-yank-filter-group ibuffer-yank
-;;;;;;  ibuffer-kill-line ibuffer-kill-filter-group ibuffer-jump-to-filter-group
-;;;;;;  ibuffer-clear-filter-groups ibuffer-decompose-filter-group
-;;;;;;  ibuffer-pop-filter-group ibuffer-set-filter-groups-by-mode
-;;;;;;  ibuffer-filters-to-filter-group ibuffer-included-in-filters-p
-;;;;;;  ibuffer-backward-filter-group ibuffer-forward-filter-group
-;;;;;;  ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group
-;;;;;;  ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode
-;;;;;;  ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "2c628e6cde385119c5f7b43cc1efe1a1")
+;;;### (autoloads nil "ibuf-ext" "ibuf-ext.el" "9521139d5f2ba7c870e3101fd73bb3ce")
 ;;; Generated autoloads from ibuf-ext.el
 
 (autoload 'ibuffer-auto-mode "ibuf-ext" "\
 ;;; Generated autoloads from ibuf-ext.el
 
 (autoload 'ibuffer-auto-mode "ibuf-ext" "\
@@ -2999,7 +2961,7 @@ Mark buffers which have not been viewed in `ibuffer-old-time' hours.
 \(fn)" t nil)
 
 (autoload 'ibuffer-mark-special-buffers "ibuf-ext" "\
 \(fn)" t nil)
 
 (autoload 'ibuffer-mark-special-buffers "ibuf-ext" "\
-Mark all buffers whose name begins and ends with '*'.
+Mark all buffers whose name begins and ends with `*'.
 
 \(fn)" t nil)
 
 
 \(fn)" t nil)
 
@@ -3029,8 +2991,4 @@ defaults to one.
 
 (run-hooks 'ibuffer-load-hook)
 
 
 (run-hooks 'ibuffer-load-hook)
 
-;; Local Variables:
-;; coding: utf-8
-;; End:
-
 ;;; ibuffer.el ends here
 ;;; ibuffer.el ends here