Function: mode-local-map-file-buffers

mode-local-map-file-buffers is a byte-compiled function defined in mode-local.el.gz.

Signature

(mode-local-map-file-buffers FUNCTION &optional PREDICATE BUFFERS)

Documentation

Run FUNCTION on every file buffer found.

FUNCTION does not have arguments; when it is entered current-buffer is the currently selected file buffer. If optional argument PREDICATE is non-nil, only select file buffers for which the function PREDICATE returns non-nil. If optional argument BUFFERS is non-nil, it is a list of buffers to walk through. It defaults to buffer-list.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/mode-local.el.gz
;; For find-function-regexp-alist. It is tempting to replace this
;; require’ by (defvar find-function-regexp-alist) and
;; with-eval-after-load, but model-local.el is typically loaded when a
;; semantic autoload is invoked, and something in semantic loads
;; find-func.el before mode-local.el, so the eval-after-load is lost.

;;; Misc utilities
;;
(defun mode-local-map-file-buffers (function &optional predicate buffers)
  "Run FUNCTION on every file buffer found.
FUNCTION does not have arguments; when it is entered `current-buffer'
is the currently selected file buffer.
If optional argument PREDICATE is non-nil, only select file buffers
for which the function PREDICATE returns non-nil.
If optional argument BUFFERS is non-nil, it is a list of buffers to
walk through.  It defaults to `buffer-list'."
  (dolist (b (or buffers (buffer-list)))
    (and (buffer-live-p b) (buffer-file-name b)
         (with-current-buffer b
           (when (or (not predicate) (funcall predicate))
             (funcall function))))))