     (pcase (seq-length panes)
       (1 nil)
       ((let `nil nextindex)
-       (seq-find
-        (lambda (pane)
-          (eq minindex (glof:get pane :index)))
-        panes))
+       (mesh:find-index minindex panes))
       ((let _ nextindex)
-       (seq-find
-        (lambda (pane)
-          (eq nextindex (glof:get pane :index)))
-        panes)))))
+       (mesh:find-index nextindex panes)))))
 
 (cl-defun mesh:find-next-tab (curtab tabs)
   (cl-letf* ((indices (mesh:sort-numbers (mesh:get-indices tabs)))

                                            maxindex
                                            indices)))
    (if nextindex
        (seq-find
         (lambda (tab)
           (eq nextindex (glof:get tab :index)))
         tabs)
      (seq-find
       (lambda (tab)
         (eq minindex (glof:get tab :index)))
       tabs))))

(cl-defun mesh:find-next-session (cursession sessions)
  (cl-letf* ((cursessionpos (seq-position


(cl-defun mesh:find-next-index-rec (index maxindex lst)
  (if (or (colle:empty-p lst)
         (eq index maxindex))
      nil
    (cl-letf* ((target (1+ index))
               (next (seq-find (lambda (e) (cl-equalp e target))  lst)))
