Function: projectile--repeat-until-project-buffer

projectile--repeat-until-project-buffer is a byte-compiled function defined in projectile.el.

Signature

(projectile--repeat-until-project-buffer ORIG-FUN &rest ARGS)

Documentation

Repeat ORIG-FUN with ARGS until the current buffer is a project buffer.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
;;; Find next/previous project buffer
(defun projectile--repeat-until-project-buffer (orig-fun &rest args)
  "Repeat ORIG-FUN with ARGS until the current buffer is a project buffer."
  (if (projectile-project-root)
      (let* ((other-project-buffers (make-hash-table :test 'eq))
             (projectile-project-buffers (projectile-project-buffers))
             (max-iterations (length (buffer-list)))
             (counter 0))
        (dolist (buffer projectile-project-buffers)
          (unless (eq buffer (current-buffer))
            (puthash buffer t other-project-buffers)))
        (when (cdr-safe projectile-project-buffers)
          (while (and (< counter max-iterations)
                      (not (gethash (current-buffer) other-project-buffers)))
            (apply orig-fun args)
            (setq counter (1+ counter)))))
    (apply orig-fun args)))