Mercurial > emacs
comparison lisp/ibuf-ext.el @ 87790:d4459bad23ea
(ibuffer-auto-update-changed, ibuffer-auto-mode): Use derived-mode-p.
(ibuffer-mark-by-mode-regexp): Pass the buffer to format-mode-line.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 16 Jan 2008 15:57:42 +0000 |
parents | 107ccd98fa12 |
children | 0df22905486e |
comparison
equal
deleted
inserted
replaced
87789:16e347bbe4ce | 87790:d4459bad23ea |
---|---|
226 (when (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) | 226 (when (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) |
227 (dolist (buf (buffer-list)) | 227 (dolist (buf (buffer-list)) |
228 (ignore-errors | 228 (ignore-errors |
229 (with-current-buffer buf | 229 (with-current-buffer buf |
230 (when (and ibuffer-auto-mode | 230 (when (and ibuffer-auto-mode |
231 (eq major-mode 'ibuffer-mode)) | 231 (derived-mode-p 'ibuffer-mode)) |
232 (ibuffer-update nil t))))))) | 232 (ibuffer-update nil t))))))) |
233 | 233 |
234 ;;;###autoload | 234 ;;;###autoload |
235 (defun ibuffer-auto-mode (&optional arg) | 235 (defun ibuffer-auto-mode (&optional arg) |
236 "Toggle use of Ibuffer's auto-update facility. | 236 "Toggle use of Ibuffer's auto-update facility. |
237 With numeric ARG, enable auto-update if and only if ARG is positive." | 237 With numeric ARG, enable auto-update if and only if ARG is positive." |
238 (interactive) | 238 (interactive) |
239 (unless (eq major-mode 'ibuffer-mode) | 239 (unless (derived-mode-p 'ibuffer-mode) |
240 (error "This buffer is not in Ibuffer mode")) | 240 (error "This buffer is not in Ibuffer mode")) |
241 (set (make-local-variable 'ibuffer-auto-mode) | 241 (set (make-local-variable 'ibuffer-auto-mode) |
242 (if arg | 242 (if arg |
243 (plusp arg) | 243 (plusp arg) |
244 (not ibuffer-auto-mode))) | 244 (not ibuffer-auto-mode))) |
1384 "Mark all buffers whose major mode matches REGEXP." | 1384 "Mark all buffers whose major mode matches REGEXP." |
1385 (interactive "sMark by major mode (regexp): ") | 1385 (interactive "sMark by major mode (regexp): ") |
1386 (ibuffer-mark-on-buffer | 1386 (ibuffer-mark-on-buffer |
1387 #'(lambda (buf) | 1387 #'(lambda (buf) |
1388 (with-current-buffer buf | 1388 (with-current-buffer buf |
1389 (string-match regexp (format-mode-line mode-name)))))) | 1389 (string-match regexp (format-mode-line mode-name nil nil buf)))))) |
1390 | 1390 |
1391 ;;;###autoload | 1391 ;;;###autoload |
1392 (defun ibuffer-mark-by-file-name-regexp (regexp) | 1392 (defun ibuffer-mark-by-file-name-regexp (regexp) |
1393 "Mark all buffers whose file name matches REGEXP." | 1393 "Mark all buffers whose file name matches REGEXP." |
1394 (interactive "sMark by file name (regexp): ") | 1394 (interactive "sMark by file name (regexp): ") |
1537 (push buf ibuffer-do-occur-bufs))) | 1537 (push buf ibuffer-do-occur-bufs))) |
1538 (occur-1 regexp nlines ibuffer-do-occur-bufs))) | 1538 (occur-1 regexp nlines ibuffer-do-occur-bufs))) |
1539 | 1539 |
1540 (provide 'ibuf-ext) | 1540 (provide 'ibuf-ext) |
1541 | 1541 |
1542 ;;; arch-tag: 9af21953-deda-4c30-b76d-f81d9128e76d | 1542 ;; arch-tag: 9af21953-deda-4c30-b76d-f81d9128e76d |
1543 ;;; ibuf-ext.el ends here | 1543 ;;; ibuf-ext.el ends here |