Mercurial > emacs
comparison lisp/ibuffer.el @ 44482:510e978b6292
(ibuffer-canonicalize-state-list): Delete unused function.
(ibuffer-current-buffers-with-marks): Don't call `buffer-list'
ourselves; take it as an argument. Caller updated.
(ibuffer-mode): Make mode-class special.
author | Colin Walters <walters@gnu.org> |
---|---|
date | Wed, 10 Apr 2002 19:11:45 +0000 |
parents | 8bff6cc92867 |
children | 5fa7b088231f |
comparison
equal
deleted
inserted
replaced
44481:a0dc261f564a | 44482:510e978b6292 |
---|---|
1677 #'(lambda (buf mark beg end) | 1677 #'(lambda (buf mark beg end) |
1678 (when (buffer-live-p buf) | 1678 (when (buffer-live-p buf) |
1679 (push (cons buf mark) ibuffer-current-state-list-tmp))))) | 1679 (push (cons buf mark) ibuffer-current-state-list-tmp))))) |
1680 (nreverse ibuffer-current-state-list-tmp))) | 1680 (nreverse ibuffer-current-state-list-tmp))) |
1681 | 1681 |
1682 (defsubst ibuffer-canonicalize-state-list (bmarklist) | 1682 (defun ibuffer-current-buffers-with-marks (bufs) |
1683 "Order BMARKLIST in the same way as the current buffer list." | |
1684 (delq nil | |
1685 (mapcar #'(lambda (buf) (assq buf bmarklist)) (buffer-list)))) | |
1686 | |
1687 (defun ibuffer-current-buffers-with-marks () | |
1688 "Return a list like (BUF . MARK) of all open buffers." | 1683 "Return a list like (BUF . MARK) of all open buffers." |
1689 (let ((bufs (ibuffer-current-state-list))) | 1684 (let ((bufs (ibuffer-current-state-list))) |
1690 (mapcar #'(lambda (buf) (let ((e (assq buf bufs))) | 1685 (mapcar #'(lambda (buf) (let ((e (assq buf bufs))) |
1691 (if e | 1686 (if e |
1692 e | 1687 e |
1693 (cons buf ? )))) | 1688 (cons buf ? )))) |
1694 (buffer-list)))) | 1689 bufs))) |
1695 | 1690 |
1696 (defun ibuffer-buf-matches-predicates (buf predicates) | 1691 (defun ibuffer-buf-matches-predicates (buf predicates) |
1697 (let ((hit nil) | 1692 (let ((hit nil) |
1698 (name (buffer-name buf))) | 1693 (name (buffer-name buf))) |
1699 (dolist (pred predicates) | 1694 (dolist (pred predicates) |
1903 ;; This is a hack. | 1898 ;; This is a hack. |
1904 (string-match " \\*Minibuf" | 1899 (string-match " \\*Minibuf" |
1905 (buffer-name (cadr bufs)))) | 1900 (buffer-name (cadr bufs)))) |
1906 (caddr bufs) | 1901 (caddr bufs) |
1907 (cadr bufs)) | 1902 (cadr bufs)) |
1908 (ibuffer-current-buffers-with-marks) | 1903 (ibuffer-current-buffers-with-marks bufs) |
1909 arg))) | 1904 arg))) |
1910 (when (null blist) | 1905 (when (null blist) |
1911 (if (and (featurep 'ibuf-ext) | 1906 (if (and (featurep 'ibuf-ext) |
1912 ibuffer-filtering-qualifiers) | 1907 ibuffer-filtering-qualifiers) |
1913 (message "No buffers! (note: filtering in effect)") | 1908 (message "No buffers! (note: filtering in effect)") |
2046 (setq buffer-read-only t)) | 2041 (setq buffer-read-only t)) |
2047 (unless ibuffer-expert | 2042 (unless ibuffer-expert |
2048 (message "Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help"))) | 2043 (message "Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help"))) |
2049 (select-window owin)))))) | 2044 (select-window owin)))))) |
2050 | 2045 |
2046 (put 'ibuffer-mode 'mode-class 'special) | |
2051 (defun ibuffer-mode () | 2047 (defun ibuffer-mode () |
2052 "A major mode for viewing a list of buffers. | 2048 "A major mode for viewing a list of buffers. |
2053 In ibuffer, you can conveniently perform many operations on the | 2049 In ibuffer, you can conveniently perform many operations on the |
2054 currently open buffers, in addition to filtering your view to a | 2050 currently open buffers, in addition to filtering your view to a |
2055 particular subset of them, and sorting by various criteria. | 2051 particular subset of them, and sorting by various criteria. |