about summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
authorCase Duckworth2022-07-11 20:00:04 -0500
committerCase Duckworth2022-07-11 20:00:04 -0500
commitf345dd91b6d8cbece44616dcf72c00d26af14d0c (patch)
tree9cec8da1e5b9f44069c9da18070690f056a1cfb6 /lisp/acdw.el
parentAdd goto-matching-paren (diff)
downloademacs-f345dd91b6d8cbece44616dcf72c00d26af14d0c.tar.gz
emacs-f345dd91b6d8cbece44616dcf72c00d26af14d0c.zip
2022-07-11
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index fdcca84..26d1494 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -94,17 +94,19 @@ If body executes without errors, MESSAGE...Done will be displayed."
94 (:success (message "%s...done" ,msg)) 94 (:success (message "%s...done" ,msg))
95 (t (signal (car e) (cdr e))))))) 95 (t (signal (car e) (cdr e)))))))
96 96
97(defun +mapc-some-buffers (func &optional predicate) 97(defun +mapc-some-buffers (func &optional predicate-or-modes)
98 "Perform FUNC on all buffers satisfied by PREDICATE. 98 "Perform FUNC on all buffers satisfied by PREDICATE-OR-MODES.
99By default, act on all buffers. 99By default, act on all buffers.
100 100
101Both PREDICATE and FUNC are called with no arguments, but within 101Both PREDICATE-OR-MODES and FUNC are called with no arguments,
102a `with-current-buffer' form on the currently-active buffer. 102but within a `with-current-buffer' form on the currently-active
103buffer.
103 104
104As a special case, if PREDICATE is a list, it will be interpreted 105As a special case, if PREDICATE-OR-MODES is a list, it will be
105as a list of major modes. In this case, FUNC will only be called 106interpreted as a list of major modes. In this case, FUNC will
106on buffers derived from one of the modes in PREDICATE." 107only be called on buffers derived from one of the modes in
107 (let ((pred (or predicate t))) 108PREDICATE-OR-MODES."
109 (let ((pred (or predicate-or-modes t)))
108 (dolist (buf (buffer-list)) 110 (dolist (buf (buffer-list))
109 (with-current-buffer buf 111 (with-current-buffer buf
110 (when (cond ((functionp pred) 112 (when (cond ((functionp pred)