<commit_before>(in-package :lem-lispworks)

(defclass lem-pane (capi:column-layout)
  ((minibuffer
    :accessor lem-pane-minibuffer)
   (modified-p
    :initform nil
    :accessor lem-pane-modified-p)))

(defmethod initialize-instance :after ((lem-pane lem-pane) &rest initargs)
  (declare (ignore initargs))
  (let ((minibuffer-pane (make-instance 'window-pane
                                        :visible-max-height '(:character 1))))
    (setf (lem-pane-minibuffer lem-pane) minibuffer-pane)
    (setf (capi:layout-description lem-pane)
          (list (make-instance 'capi:column-layout
                               :description
                               (list nil
                                     minibuffer-pane))))))

(defun set-first-window (lem-pane window-pane)
  (with-apply-in-pane-process-wait-single (lem-pane)
    (setf (capi:layout-description (first (capi:layout-description lem-pane)))
          (list window-pane (lem-pane-minibuffer lem-pane)))))

(defun all-window-panes (lem-pane)
  (with-apply-in-pane-process-wait-single (lem-pane)
    (let ((window-panes '()))
      (capi:map-pane-descendant-children
       lem-pane
       (lambda (pane)
         (when (typep pane 'window-pane)
           (push pane window-panes))))
      window-panes)))

(defun lem-pane-width (lem-pane)<commit_msg>add map-window-panes<commit_after>(in-package :lem-lispworks)

(defclass lem-pane (capi:column-layout)
  ((minibuffer
    :accessor lem-pane-minibuffer)
   (modified-p
    :initform nil
    :accessor lem-pane-modified-p)))

(defmethod initialize-instance :after ((lem-pane lem-pane) &rest initargs)
  (declare (ignore initargs))
  (let ((minibuffer-pane (make-instance 'window-pane
                                        :visible-max-height '(:character 1))))
    (setf (lem-pane-minibuffer lem-pane) minibuffer-pane)
    (setf (capi:layout-description lem-pane)
          (list (make-instance 'capi:column-layout
                               :description
                               (list nil
                                     minibuffer-pane))))))

(defun set-first-window (lem-pane window-pane)
  (with-apply-in-pane-process-wait-single (lem-pane)
    (setf (capi:layout-description (first (capi:layout-description lem-pane)))
          (list window-pane (lem-pane-minibuffer lem-pane)))))

(defun map-window-panes (lem-pane function)
  (with-apply-in-pane-process-wait-single (lem-pane)
    (capi:map-pane-descendant-children
     lem-pane
     (lambda (pane)
       (when (typep pane 'window-pane)
         (funcall function pane))))))

(defun all-window-panes (lem-pane)
  (let ((window-panes '()))
    (map-window-panes lem-pane
                      (lambda (window-pane)
                        (push window-pane window-panes)))
    window-panes))

(defun lem-pane-width (lem-pane)
{'fraction_non_alphanumeric': 0.13937035726918995, 'fraction_numerical': 0.0007074637424831977, 'mean_word_length': 2.303738317757009, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4422122', 'n_tokens_mistral': 987, 'n_tokens_neox': 971, 'n_words': 173}