diff options
| author | Colin Walters | 2002-06-08 20:42:26 +0000 |
|---|---|---|
| committer | Colin Walters | 2002-06-08 20:42:26 +0000 |
| commit | 545aad2f09418beb19ecdd4416123bbd1d8dce82 (patch) | |
| tree | 08a938b03549ecc95efdb53882ba9c9ef7d093cf | |
| parent | 1b6adddbc333390fa3a66c4d698b4b7c79105f56 (diff) | |
| download | emacs-545aad2f09418beb19ecdd4416123bbd1d8dce82.tar.gz emacs-545aad2f09418beb19ecdd4416123bbd1d8dce82.zip | |
(ibuffer-category-alist): Delete.
(ibuffer-get-category): Delete.
(ibuffer-compile-make-eliding-form): Use `font-lock-face' instead
of categories.
(ibuffer-compile-format): Don't treat `name' category specially.
(ibuffer-column name): Use `font-lock-face'.
(filename-and-process): Ditto.
(ibuffer-buffer-name-category): Renamed to
`ibuffer-buffer-name-face'. Don't use categories.
(ibuffer-update-title-and-summary): Use `font-lock-face'.
(ibuffer-insert-filter-group): Ditto.
(ibuffer-mode): Don't set up categories.
| -rw-r--r-- | lisp/ibuffer.el | 68 |
1 files changed, 13 insertions, 55 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index b4f4aecf720..3c9bf9eb679 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -742,7 +742,7 @@ directory, like `default-directory'." | |||
| 742 | '(menu-item "Kill filter group" | 742 | '(menu-item "Kill filter group" |
| 743 | ibuffer-kill-line | 743 | ibuffer-kill-line |
| 744 | :enable (and (featurep 'ibuf-ext) ibuffer-filter-groups))) | 744 | :enable (and (featurep 'ibuf-ext) ibuffer-filter-groups))) |
| 745 | (define-key ibuffer-mode-groups-popup [yank-filter-group] | 745 | (define-key ibuffer-mode-groups-popup [yank-filter-group] |
| 746 | '(menu-item "Yank last killed filter group" | 746 | '(menu-item "Yank last killed filter group" |
| 747 | ibuffer-yank | 747 | ibuffer-yank |
| 748 | :enable (and (featurep 'ibuf-ext) ibuffer-filter-group-kill-ring))) | 748 | :enable (and (featurep 'ibuf-ext) ibuffer-filter-group-kill-ring))) |
| @@ -777,7 +777,6 @@ directory, like `default-directory'." | |||
| 777 | "Whether or not to delete the window upon exiting `ibuffer'.") | 777 | "Whether or not to delete the window upon exiting `ibuffer'.") |
| 778 | 778 | ||
| 779 | (defvar ibuffer-did-modification nil) | 779 | (defvar ibuffer-did-modification nil) |
| 780 | (defvar ibuffer-category-alist nil) | ||
| 781 | 780 | ||
| 782 | (defvar ibuffer-sorting-functions-alist nil | 781 | (defvar ibuffer-sorting-functions-alist nil |
| 783 | "An alist of functions which describe how to sort buffers. | 782 | "An alist of functions which describe how to sort buffers. |
| @@ -1351,14 +1350,9 @@ If point is on a group name, this function operates on that group." | |||
| 1351 | elide nil)) | 1350 | elide nil)) |
| 1352 | (list sym min max align elide))) | 1351 | (list sym min max align elide))) |
| 1353 | form)) | 1352 | form)) |
| 1354 | |||
| 1355 | (defsubst ibuffer-get-category (name) | ||
| 1356 | (cdr (assq name ibuffer-category-alist))) | ||
| 1357 | 1353 | ||
| 1358 | (defun ibuffer-compile-make-eliding-form (strvar elide from-end-p) | 1354 | (defun ibuffer-compile-make-eliding-form (strvar elide from-end-p) |
| 1359 | (let ((ellipsis (propertize ibuffer-eliding-string 'category | 1355 | (let ((ellipsis (propertize ibuffer-eliding-string 'font-lock-face 'bold))) |
| 1360 | (ibuffer-get-category | ||
| 1361 | 'ibuffer-category-eliding-string)))) | ||
| 1362 | (if (or elide ibuffer-elide-long-columns) | 1356 | (if (or elide ibuffer-elide-long-columns) |
| 1363 | `(if (> strlen 5) | 1357 | `(if (> strlen 5) |
| 1364 | ,(if from-end-p | 1358 | ,(if from-end-p |
| @@ -1469,16 +1463,8 @@ If point is on a group name, this function operates on that group." | |||
| 1469 | (put ',sym 'ibuffer-column-summary | 1463 | (put ',sym 'ibuffer-column-summary |
| 1470 | (cons ret (get ',sym 'ibuffer-column-summary))) | 1464 | (cons ret (get ',sym 'ibuffer-column-summary))) |
| 1471 | ret))) | 1465 | ret))) |
| 1472 | ;; We handle the `name' column specially. | 1466 | (lambda (arg sym) |
| 1473 | (if (eq sym 'ibuffer-make-column-name) | 1467 | `(insert ,arg)))) |
| 1474 | (lambda (arg sym) | ||
| 1475 | `(let ((pt (point))) | ||
| 1476 | (insert ,arg) | ||
| 1477 | (put-text-property pt (point) | ||
| 1478 | 'category | ||
| 1479 | (ibuffer-buffer-name-category buffer mark)))) | ||
| 1480 | (lambda (arg sym) | ||
| 1481 | `(insert ,arg))))) | ||
| 1482 | (mincompform `(< strlen ,(if (integerp min) | 1468 | (mincompform `(< strlen ,(if (integerp min) |
| 1483 | min | 1469 | min |
| 1484 | 'min))) | 1470 | 'min))) |
| @@ -1611,7 +1597,7 @@ If point is on a group name, this function operates on that group." | |||
| 1611 | ('mouse-face 'highlight 'keymap ibuffer-name-map | 1597 | ('mouse-face 'highlight 'keymap ibuffer-name-map |
| 1612 | 'ibuffer-name-column t | 1598 | 'ibuffer-name-column t |
| 1613 | 'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer")) | 1599 | 'help-echo "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer")) |
| 1614 | (buffer-name)) | 1600 | (propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark))) |
| 1615 | 1601 | ||
| 1616 | (define-ibuffer-column size (:inline t) | 1602 | (define-ibuffer-column size (:inline t) |
| 1617 | (format "%s" (buffer-size))) | 1603 | (format "%s" (buffer-size))) |
| @@ -1641,9 +1627,7 @@ If point is on a group name, this function operates on that group." | |||
| 1641 | (filename (ibuffer-make-column-filename buffer mark ibuffer-buf))) | 1627 | (filename (ibuffer-make-column-filename buffer mark ibuffer-buf))) |
| 1642 | (if proc | 1628 | (if proc |
| 1643 | (concat (propertize (format "(%s %s) " proc (process-status proc)) | 1629 | (concat (propertize (format "(%s %s) " proc (process-status proc)) |
| 1644 | 'category | 1630 | 'font-lock-face 'italic) |
| 1645 | (with-current-buffer ibuffer-buf | ||
| 1646 | (ibuffer-get-category 'ibuffer-category-process))) | ||
| 1647 | filename) | 1631 | filename) |
| 1648 | filename))) | 1632 | filename))) |
| 1649 | 1633 | ||
| @@ -1655,22 +1639,20 @@ If point is on a group name, this function operates on that group." | |||
| 1655 | (:center (concat left str right)) | 1639 | (:center (concat left str right)) |
| 1656 | (t (concat str left right))))) | 1640 | (t (concat str left right))))) |
| 1657 | 1641 | ||
| 1658 | (defun ibuffer-buffer-name-category (buf mark) | 1642 | (defun ibuffer-buffer-name-face (buf mark) |
| 1659 | (cond ((char-equal mark ibuffer-marked-char) | 1643 | (cond ((char-equal mark ibuffer-marked-char) |
| 1660 | (ibuffer-get-category 'ibuffer-category-marked)) | 1644 | ibuffer-marked-face) |
| 1661 | ((char-equal mark ibuffer-deletion-char) | 1645 | ((char-equal mark ibuffer-deletion-char) |
| 1662 | (ibuffer-get-category 'ibuffer-category-deleted)) | 1646 | ibuffer-deletion-face) |
| 1663 | (t | 1647 | (t |
| 1664 | (let ((level -1) | 1648 | (let ((level -1) |
| 1665 | (i 0) | ||
| 1666 | result) | 1649 | result) |
| 1667 | (dolist (e ibuffer-fontification-alist result) | 1650 | (dolist (e ibuffer-fontification-alist result) |
| 1668 | (when (and (> (car e) level) | 1651 | (when (and (> (car e) level) |
| 1669 | (with-current-buffer buf | 1652 | (with-current-buffer buf |
| 1670 | (eval (cadr e)))) | 1653 | (eval (nth 1 e)))) |
| 1671 | (setq level (car e) | 1654 | (setq level (car e) |
| 1672 | result (car (nth i font-lock-category-alist)))) | 1655 | result (nth 2 e)))))))) |
| 1673 | (incf i)))))) | ||
| 1674 | 1656 | ||
| 1675 | (defun ibuffer-insert-buffer-line (buffer mark format) | 1657 | (defun ibuffer-insert-buffer-line (buffer mark format) |
| 1676 | "Insert a line describing BUFFER and MARK using FORMAT." | 1658 | "Insert a line describing BUFFER and MARK using FORMAT." |
| @@ -1922,7 +1904,7 @@ the value of point at the beginning of the line for that buffer." | |||
| 1922 | str))) | 1904 | str))) |
| 1923 | (insert "\n")) | 1905 | (insert "\n")) |
| 1924 | (point)) | 1906 | (point)) |
| 1925 | `(ibuffer-title t category ,(ibuffer-get-category 'ibuffer-category-title))) | 1907 | `(ibuffer-title t font-lock-face ,ibuffer-title-face)) |
| 1926 | ;; Now, insert the summary columns. | 1908 | ;; Now, insert the summary columns. |
| 1927 | (goto-char (point-max)) | 1909 | (goto-char (point-max)) |
| 1928 | (if (get-text-property (1- (point-max)) 'ibuffer-summary) | 1910 | (if (get-text-property (1- (point-max)) 'ibuffer-summary) |
| @@ -2066,7 +2048,7 @@ Do not display messages if SILENT is non-nil." | |||
| 2066 | (point)) | 2048 | (point)) |
| 2067 | `(ibuffer-filter-group-name | 2049 | `(ibuffer-filter-group-name |
| 2068 | ,name | 2050 | ,name |
| 2069 | category ,(ibuffer-get-category 'ibuffer-category-filter-group-name) | 2051 | font-lock-face ,ibuffer-filter-group-name-face |
| 2070 | keymap ,ibuffer-mode-filter-group-map | 2052 | keymap ,ibuffer-mode-filter-group-map |
| 2071 | mouse-face highlight | 2053 | mouse-face highlight |
| 2072 | help-echo ,(concat filter-string "mouse-1: toggle marks in this group\nmouse-2: hide/show this filtering group "))) | 2054 | help-echo ,(concat filter-string "mouse-1: toggle marks in this group\nmouse-2: hide/show this filtering group "))) |
| @@ -2396,30 +2378,6 @@ will be inserted before the group at point." | |||
| 2396 | ;; This makes things less ugly for Emacs 21 users with a non-nil | 2378 | ;; This makes things less ugly for Emacs 21 users with a non-nil |
| 2397 | ;; `show-trailing-whitespace'. | 2379 | ;; `show-trailing-whitespace'. |
| 2398 | (setq show-trailing-whitespace nil) | 2380 | (setq show-trailing-whitespace nil) |
| 2399 | |||
| 2400 | (set (make-local-variable 'font-lock-category-alist) nil) | ||
| 2401 | (set (make-local-variable 'ibuffer-category-alist) nil) | ||
| 2402 | (dolist (elt (list | ||
| 2403 | (cons (make-symbol "ibuffer-category-title") | ||
| 2404 | ibuffer-title-face) | ||
| 2405 | (cons (make-symbol "ibuffer-category-marked") | ||
| 2406 | ibuffer-marked-face) | ||
| 2407 | (cons (make-symbol "ibuffer-category-deleted") | ||
| 2408 | ibuffer-deletion-face) | ||
| 2409 | (cons (make-symbol "ibuffer-category-filter-group-name") | ||
| 2410 | ibuffer-filter-group-name-face) | ||
| 2411 | (cons (make-symbol "ibuffer-category-process") | ||
| 2412 | 'italic) | ||
| 2413 | (cons (make-symbol "ibuffer-category-eliding-string") | ||
| 2414 | 'bold))) | ||
| 2415 | (push (cons (intern (symbol-name (car elt))) (car elt)) ibuffer-category-alist) | ||
| 2416 | (push elt font-lock-category-alist)) | ||
| 2417 | (let ((i (1- (length ibuffer-fontification-alist)))) | ||
| 2418 | (while (>= i 0) | ||
| 2419 | (push (cons (make-symbol (format "ibuffer-category-%d" i)) | ||
| 2420 | (nth 2 (nth i ibuffer-fontification-alist))) | ||
| 2421 | font-lock-category-alist) | ||
| 2422 | (decf i))) | ||
| 2423 | (set (make-local-variable 'revert-buffer-function) | 2381 | (set (make-local-variable 'revert-buffer-function) |
| 2424 | #'ibuffer-update) | 2382 | #'ibuffer-update) |
| 2425 | (set (make-local-variable 'ibuffer-sorting-mode) | 2383 | (set (make-local-variable 'ibuffer-sorting-mode) |