aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Paul Wallington2006-02-02 21:55:33 +0000
committerJohn Paul Wallington2006-02-02 21:55:33 +0000
commit9fe14abebd0e592e60fcd12d2f3b816600771236 (patch)
treef4573d1113b643bca1b258ee55319ce162236ab7
parentf161b0795cbc9c189046326f80d45ea0df94e5a8 (diff)
downloademacs-9fe14abebd0e592e60fcd12d2f3b816600771236.tar.gz
emacs-9fe14abebd0e592e60fcd12d2f3b816600771236.zip
(ibuffer-compressed-file-name-regexp): New defcustom.
(ibuffer-fontification-alist): Use it. (ibuffer-mode-map): Bind `ibuffer-mark-compressed-file-buffers' to "* z" and the Ibuffer Mark menu.
-rw-r--r--lisp/ibuffer.el24
1 files changed, 20 insertions, 4 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 9406cf0a1b8..3f6ae484ddd 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -142,12 +142,16 @@ elisp byte-compiler."
142 142
143(defcustom ibuffer-fontification-alist 143(defcustom ibuffer-fontification-alist
144 `((10 buffer-read-only font-lock-constant-face) 144 `((10 buffer-read-only font-lock-constant-face)
145 (15 (string-match "^*" (buffer-name)) font-lock-keyword-face) 145 (15 (and buffer-file-name
146 (20 (and (string-match "^ " (buffer-name)) 146 (string-match ibuffer-compressed-file-name-regexp
147 buffer-file-name))
148 font-lock-doc-face)
149 (20 (string-match "^*" (buffer-name)) font-lock-keyword-face)
150 (25 (and (string-match "^ " (buffer-name))
147 (null buffer-file-name)) 151 (null buffer-file-name))
148 italic) 152 italic)
149 (25 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face) 153 (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face)
150 (30 (eq major-mode 'dired-mode) font-lock-function-name-face)) 154 (35 (eq major-mode 'dired-mode) font-lock-function-name-face))
151 "An alist describing how to fontify buffers. 155 "An alist describing how to fontify buffers.
152Each element should be of the form (PRIORITY FORM FACE), where 156Each element should be of the form (PRIORITY FORM FACE), where
153PRIORITY is an integer, FORM is an arbitrary form to evaluate in the 157PRIORITY is an integer, FORM is an arbitrary form to evaluate in the
@@ -320,6 +324,14 @@ directory, like `default-directory'."
320 :type '(repeat function) 324 :type '(repeat function)
321 :group 'ibuffer) 325 :group 'ibuffer)
322 326
327(defcustom ibuffer-compressed-file-name-regexp
328 (concat "\\.\\("
329 (regexp-opt '("arj" "bgz" "bz2" "gz" "lzh" "taz" "tgz" "zip" "z"))
330 "\\)$")
331 "Regexp to match compressed file names."
332 :type 'regexp
333 :group 'ibuffer)
334
323(defcustom ibuffer-hook nil 335(defcustom ibuffer-hook nil
324 "Hook run when `ibuffer' is called." 336 "Hook run when `ibuffer' is called."
325 :type 'hook 337 :type 'hook
@@ -403,6 +415,7 @@ directory, like `default-directory'."
403 (define-key map (kbd "* /") 'ibuffer-mark-dired-buffers) 415 (define-key map (kbd "* /") 'ibuffer-mark-dired-buffers)
404 (define-key map (kbd "* e") 'ibuffer-mark-dissociated-buffers) 416 (define-key map (kbd "* e") 'ibuffer-mark-dissociated-buffers)
405 (define-key map (kbd "* h") 'ibuffer-mark-help-buffers) 417 (define-key map (kbd "* h") 'ibuffer-mark-help-buffers)
418 (define-key map (kbd "* z") 'ibuffer-mark-compressed-file-buffers)
406 (define-key map (kbd ".") 'ibuffer-mark-old-buffers) 419 (define-key map (kbd ".") 'ibuffer-mark-old-buffers)
407 420
408 (define-key map (kbd "d") 'ibuffer-mark-for-delete) 421 (define-key map (kbd "d") 'ibuffer-mark-for-delete)
@@ -718,6 +731,9 @@ directory, like `default-directory'."
718 (define-key-after map [menu-bar mark mark-help-buffers] 731 (define-key-after map [menu-bar mark mark-help-buffers]
719 '(menu-item "Mark help buffers" ibuffer-mark-help-buffers 732 '(menu-item "Mark help buffers" ibuffer-mark-help-buffers
720 :help "Mark buffers in help-mode")) 733 :help "Mark buffers in help-mode"))
734 (define-key-after map [menu-bar mark mark-compressed-file-buffers]
735 '(menu-item "Mark compressed file buffers" ibuffer-mark-compressed-file-buffers
736 :help "Mark buffers which have a file that is compressed"))
721 (define-key-after map [menu-bar mark mark-old-buffers] 737 (define-key-after map [menu-bar mark mark-old-buffers]
722 '(menu-item "Mark old buffers" ibuffer-mark-old-buffers 738 '(menu-item "Mark old buffers" ibuffer-mark-old-buffers
723 :help "Mark buffers which have not been viewed recently")) 739 :help "Mark buffers which have not been viewed recently"))