     (dolist (spec doom-popup-history)
       (let ((buffer (get-buffer (car spec)))
             (file   (plist-get (cdr spec) :file))
-            (rules  (plist-get (cdr spec) :rules)))
+            (rules  (plist-get (cdr spec) :rules))
+            (size   (plist-get (cdr spec) :size)))
         (when (and (not buffer) file)
           (setq buffer
                 (if-let (buf (get-file-buffer file))
                     (clone-indirect-buffer (buffer-name buf) nil t)
                   (find-file-noselect file t))))
+        (when size
+          (setq rules (plist-put rules :size size)))
         (when (and buffer (apply #'doom-popup-buffer buffer rules) (not any-p))
           (setq any-p t))))
     (when any-p


;;;###autoload
(defun doom-popup-windows ()
  "Get a list of open poups."
  (cl-remove-if-not #'doom-popup-p (window-list)))

;;;###autoload

  (if-let (win (get-buffer-window "*Messages*"))
      (doom/popup-close win)
    (doom-popup-buffer (get-buffer "*Messages*"))))

;;;###autoload
(defun doom-popup-prop (prop &optional window)
  (or (plist-get (or (if window
                         (buffer-local-value 'doom-popup-rules (window-buffer window))
                       doom-popup-rules)
                     (window-parameter window 'popup))
                 prop)
      (cond ((eq prop :size)
             shackle-default-size)
            ((eq prop :align)
             shackle-default-alignment))))

;;;###autoload
(defun doom-popup-side (&optional window)
  (let ((align (doom-popup-prop :align window)))
    (when (eq align t)
      (setq align shackle-default-alignment))
    (when (functionp align)
      (setq align (funcall align)))
    align))

;;;###autoload
(defun doom-popup-size (&optional window)
  (let ((side (doom-popup-side window)))
    (cond ((memq side '(left right))
           (window-width window))
          ((memq side '(above below))
           (window-height window)))))

(defun doom--popup-data (window)
  (when-let (buffer (window-buffer window))
    `(,(buffer-name buffer)
      :file  ,(buffer-file-name buffer)
      :rules ,(window-parameter window 'popup)
      :size  ,(doom-popup-size window))))
