Function: eglot--when-buffer-window

eglot--when-buffer-window is a macro defined in eglot.el.gz.

Signature

(eglot--when-buffer-window BUF &body BODY)

Documentation

Check BUF showing somewhere, then do BODY in it.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/eglot.el.gz
(cl-defmacro eglot--when-buffer-window (buf &body body)
  "Check BUF showing somewhere, then do BODY in it." (declare (indent 1) (debug t))
  (let ((b (cl-gensym)))
    `(let ((,b ,buf))
       ;;notice the exception when testing with `ert'
       (when (or (get-buffer-window ,b) (ert-running-test))
         (with-current-buffer ,b ,@body)))))