aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters2002-03-27 22:19:24 +0000
committerColin Walters2002-03-27 22:19:24 +0000
commit60356fb51b6219db944b87d2efb9aafde662c591 (patch)
treedef94b33682e9ef8b8b7da2719b1c005fec2fff2
parent2f1de3dd2613c1b1fb0e81713a4a83fa8d8aba68 (diff)
downloademacs-60356fb51b6219db944b87d2efb9aafde662c591.tar.gz
emacs-60356fb51b6219db944b87d2efb9aafde662c591.zip
(ibuffer-help-buffer-modes): New variable.
(ibuffer-fontification-alist): Use it. (ibuffer-backward-line): Handle `ibuffer-summary' area. (ibuffer-forward-line): Ditto.
-rw-r--r--lisp/ibuffer.el42
1 files changed, 23 insertions, 19 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 441f0e02119..34e53ae217b 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -145,7 +145,7 @@ elisp byte-compiler."
145 `((10 buffer-read-only font-lock-reference-face) 145 `((10 buffer-read-only font-lock-reference-face)
146 (15 (string-match "^*" (buffer-name)) font-lock-keyword-face) 146 (15 (string-match "^*" (buffer-name)) font-lock-keyword-face)
147 (20 (string-match "^ " (buffer-name)) font-lock-warning-face) 147 (20 (string-match "^ " (buffer-name)) font-lock-warning-face)
148 (25 (memq major-mode '(help-mode apropos-mode info-mode)) font-lock-comment-face) 148 (25 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face)
149 (30 (eq major-mode 'dired-mode) font-lock-function-name-face)) 149 (30 (eq major-mode 'dired-mode) font-lock-function-name-face))
150 "An alist describing how to fontify buffers. 150 "An alist describing how to fontify buffers.
151Each element should be of the form (PRIORITY FORM FACE), where 151Each element should be of the form (PRIORITY FORM FACE), where
@@ -284,6 +284,12 @@ directory, like `default-directory'."
284 string) 284 string)
285 :group 'ibuffer) 285 :group 'ibuffer)
286 286
287(defcustom ibuffer-help-buffer-modes '(help-mode apropos-mode
288 Info-mode Info-edit-mode)
289 "List of \"Help\" major modes."
290 :type '(repeat function)
291 :group 'ibuffer)
292
287(defcustom ibuffer-hooks nil 293(defcustom ibuffer-hooks nil
288 "Hooks run when `ibuffer' is called." 294 "Hooks run when `ibuffer' is called."
289 :type 'hook 295 :type 'hook
@@ -801,9 +807,15 @@ width and the longest string in LIST."
801 (forward-line -1) 807 (forward-line -1)
802 (when (get-text-property (point) 'ibuffer-title) 808 (when (get-text-property (point) 'ibuffer-title)
803 (goto-char (point-max)) 809 (goto-char (point-max))
810 (beginning-of-line))
811 (while (get-text-property (point) 'ibuffer-summary)
804 (forward-line -1) 812 (forward-line -1)
805 (setq arg 0)) 813 (beginning-of-line))
806 (setq arg (1- arg)))) 814 ;; Handle the special case of no buffers.
815 (when (get-text-property (point) 'ibuffer-title)
816 (forward-line 1)
817 (setq arg 1))
818 (decf arg)))
807 819
808(defun ibuffer-forward-line (&optional arg) 820(defun ibuffer-forward-line (&optional arg)
809 "Move forward ARG lines, wrapping around the list if necessary." 821 "Move forward ARG lines, wrapping around the list if necessary."
@@ -813,22 +825,14 @@ width and the longest string in LIST."
813 (beginning-of-line) 825 (beginning-of-line)
814 (if (< arg 0) 826 (if (< arg 0)
815 (ibuffer-backward-line (- arg)) 827 (ibuffer-backward-line (- arg))
816 (progn 828 (while (> arg 0)
817 (when (get-text-property (point) 'ibuffer-title) 829 (forward-line 1)
818 ;; If we're already on the title, moving past it counts as 830 (when (or (eobp)
819 ;; moving a line. 831 (get-text-property (point) 'ibuffer-summary))
820 (decf arg) 832 (goto-char (point-min)))
821 (while (and (get-text-property (point) 'ibuffer-title) 833 (while (get-text-property (point) 'ibuffer-title)
822 (not (eobp))) 834 (forward-line 1))
823 (forward-line 1))) 835 (decf arg))))
824 (while (> arg 0)
825 (forward-line 1)
826 (when (eobp)
827 (goto-char (point-min)))
828 (while (and (get-text-property (point) 'ibuffer-title)
829 (not (eobp)))
830 (forward-line 1))
831 (setq arg (1- arg))))))
832 836
833(defun ibuffer-visit-buffer () 837(defun ibuffer-visit-buffer ()
834 "Visit the buffer on this line." 838 "Visit the buffer on this line."