Function: var:run-hook-in-matching-buffers

var:run-hook-in-matching-buffers is a byte-compiled function defined in hvar.el.

Signature

(var:run-hook-in-matching-buffers MODE HOOK-FUNCTION)

Documentation

Within all buffers with a given major MODE, call HOOK-FUNCTION.

This is used after a hook is changed to affect buffers that existed before the change was made.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hvar.el
(defun var:run-hook-in-matching-buffers (mode hook-function)
  "Within all buffers with a given major MODE, call HOOK-FUNCTION.
This is used after a hook is changed to affect buffers that
existed before the change was made."
  (mapc (lambda (buf) (with-current-buffer buf (funcall hook-function)))
	(delq nil (mapcar (lambda (buf) (when (eq (buffer-local-value 'major-mode buf) mode)
					  buf))
			  (buffer-list)))))