<commit_before>(dolist (sym '(mf-max-display-pixel-width
               mf-max-display-pixel-height
               maximize-frame
               restore-frame))
  (autoload sym "maxframe"))

(when *is-cocoa-emacs*
  (eval-after-load 'maxframe
    '(progn
       (fset 'maximize-frame 'x-maximize-frame)
       (fset 'restore-frame 'x-restore-frame))))

(when *macbook-pro-support-enabled*
  (setq mf-max-width 1440
        mf-max-height 894
        mf-display-padding-width 4
        mf-offset-x 0
        mf-display-padding-height (if (when (boundp 'ns-auto-hide-menu-bar)
                                        ns-auto-hide-menu-bar)
                                      23
                                    (+ 22 23))))

(defun maybe-maximize-frame (&optional frame)
  (with-selected-frame frame
    (if window-system (maximize-frame))))

(add-hook 'after-make-frame-functions 'maybe-maximize-frame)
(add-hook 'after-init-hook 'maybe-maximize-frame)

(defun within-p (a b delta)
  (<= (abs (- b a)) delta))

(defun maximized-p (&optional frame)
  (or (not (with-selected-frame frame window-system))
      (and (within-p (mf-max-display-pixel-width)
                     (frame-pixel-width frame)
                     (frame-char-width frame))<commit_msg>Explicitly require init-utils from init-maxframe<commit_after>(dolist (sym '(mf-max-display-pixel-width
               mf-max-display-pixel-height
               maximize-frame
               restore-frame))
  (autoload sym "maxframe"))

(when *is-cocoa-emacs*
  (eval-after-load 'maxframe
    '(progn
       (fset 'maximize-frame 'x-maximize-frame)
       (fset 'restore-frame 'x-restore-frame))))

(when *macbook-pro-support-enabled*
  (setq mf-max-width 1440
        mf-max-height 894
        mf-display-padding-width 4
        mf-offset-x 0
        mf-display-padding-height (if (when (boundp 'ns-auto-hide-menu-bar)
                                        ns-auto-hide-menu-bar)
                                      23
                                    (+ 22 23))))

(require 'init-utils) ; for with-selected-frame

(defun maybe-maximize-frame (&optional frame)
  (with-selected-frame frame
    (if window-system (maximize-frame))))

(add-hook 'after-make-frame-functions 'maybe-maximize-frame)
(add-hook 'after-init-hook 'maybe-maximize-frame)

(defun within-p (a b delta)
  (<= (abs (- b a)) delta))

(defun maximized-p (&optional frame)
  (or (not (with-selected-frame frame window-system))
      (and (within-p (mf-max-display-pixel-width)
                     (frame-pixel-width frame)
                     (frame-char-width frame))
{'fraction_non_alphanumeric': 0.13545663852647735, 'fraction_numerical': 0.011511895625479662, 'mean_word_length': 1.9358108108108107, 'pattern_counts': {'":': 0, '<': 5, '<?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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3049266', 'n_tokens_mistral': 880, 'n_tokens_neox': 833, 'n_words': 167}