('mouse-face 'highlight
'keymap ibuffer-mode-name-map
'help-echo "mouse-2: filter by this mode"))
- (format-mode-line mode-name))
+ (format-mode-line mode-name nil nil (current-buffer)))
(define-ibuffer-column process
(:summarizer
(point))
`(ibuffer-summary t)))))
-(defun ibuffer-update-mode-name ()
- (setq mode-name (format "Ibuffer by %s" (if ibuffer-sorting-mode
- ibuffer-sorting-mode
- "view time")))
- (when ibuffer-sorting-reversep
- (setq mode-name (concat mode-name " [rev]")))
- (when (and (featurep 'ibuf-ext)
- ibuffer-auto-mode)
- (setq mode-name (concat mode-name " (Auto)")))
- (let ((result ""))
- (when (featurep 'ibuf-ext)
- (dolist (qualifier ibuffer-filtering-qualifiers)
- (setq result
- (concat result (ibuffer-format-qualifier qualifier))))
- (if ibuffer-use-header-line
- (setq header-line-format
- (when ibuffer-filtering-qualifiers
- (replace-regexp-in-string "%" "%%"
- (concat mode-name result))))
- (progn
- (setq mode-name (concat mode-name result))
- (when (boundp 'header-line-format)
- (setq header-line-format nil)))))))
(defun ibuffer-redisplay (&optional silent)
"Redisplay the current list of buffers.
(message "No buffers! (note: filtering in effect)")
(error "No buffers!")))
(ibuffer-redisplay-engine blist t)
- (ibuffer-update-mode-name)
(unless silent
(message "Redisplaying current buffer list...done"))
(ibuffer-forward-line 0)))
(unless silent
(message "Updating buffer list..."))
(ibuffer-redisplay-engine blist arg)
- (ibuffer-update-mode-name)
(unless silent
(message "Updating buffer list...done")))
(if (eq ibuffer-shrink-to-minimum-size 'onewindow)
(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)
+ '((ibuffer-sorting-mode (:eval (symbol-name ibuffer-sorting-mode))
+ "view time")
+ (ibuffer-sorting-reversep " [rev]")
+ (ibuffer-auto-mode " (Auto)")
+ ;; Only list the filters if they're not already in the header-line.
+ (header-line-format
+ ""
+ (:eval (if (functionp 'ibuffer-format-qualifier)
+ (mapconcat 'ibuffer-format-qualifier
+ ibuffer-filtering-qualifiers ""))))))
+ (setq header-line-format
+ (if ibuffer-use-header-line
+ ;; Display the part that won't be in the mode-line.
+ (mapcar (lambda (elem) (if (eq (car-safe elem) 'header-line-format)
+ (nth 2 elem) elem))
+ mode-line-process)))
+
(setq buffer-read-only t)
(buffer-disable-undo)
(setq truncate-lines ibuffer-truncate-lines)
(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)
- ;; called after mode hooks to allow the user to add filters
- (ibuffer-update-mode-name))
+ (run-mode-hooks 'ibuffer-mode-hook))
(provide 'ibuffer)
;; coding: iso-8859-1
;; End:
-;;; arch-tag: 72581688-0603-4954-b8cf-837c700f62e8
+;; arch-tag: 72581688-0603-4954-b8cf-837c700f62e8
;;; ibuffer.el ends here