<commit_before>;;; core/autoload/popups.el -*- lexical-binding: t; -*-

(defvar doom-popup-remember-history)

;;;###autoload
(defun doom-popup-p (&optional target)
  "Return TARGET (a window) if TARGET (a window or buffer) is a popup. Uses
current window if omitted."
  (when-let (target (or target (selected-window)))
    (cond ((bufferp target)
           (buffer-local-value 'doom-popup-mode target))
          ((windowp target)
           (and (window-parameter target 'popup)
                target)))))

;;;###autoload
(defun doom-popup-buffer (buffer &rest plist)
  "Display BUFFER in a shackle popup. See `shackle-rules' for possible rules.
Returns the new popup window."
  (declare (indent defun))
  (unless (bufferp buffer)
    (error "%s is not a valid buffer" buffer))<commit_msg>Check if buffer/window is live in doom-popup-p<commit_after>;;; core/autoload/popups.el -*- lexical-binding: t; -*-

(defvar doom-popup-remember-history)

;;;###autoload
(defun doom-popup-p (&optional target)
  "Return TARGET (a window) if TARGET (a window or buffer) is a popup. Uses
current window if omitted."
  (when-let (target (or target (selected-window)))
    (cond ((bufferp target)
           (and (buffer-live-p target)
                (buffer-local-value 'doom-popup-mode target)))
          ((windowp target)
           (and (window-live-p target)
                (window-parameter target 'popup)
                target)))))

;;;###autoload
(defun doom-popup-buffer (buffer &rest plist)
  "Display BUFFER in a shackle popup. See `shackle-rules' for possible rules.
Returns the new popup window."
  (declare (indent defun))
  (unless (bufferp buffer)
    (error "%s is not a valid buffer" buffer))
{'fraction_non_alphanumeric': 0.1369782480893592, 'fraction_numerical': 0.0, 'mean_word_length': 3.1210653753026634, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7284101', 'n_tokens_mistral': 556, 'n_tokens_neox': 528, 'n_words': 176}