 
 ;;;###autoload
 (defun doom-popup-switch-to-buffer (buffer)
+  "Switch the current (or closest) pop-up window to BUFFER."
   (unless (doom-popup-p)
     (let ((popups (doom-popup-windows)))
       (unless popups

    (dolist (spec doom-popup-history)
      (let ((buffer (get-buffer (car spec)))
            (file   (plist-get (cdr spec) :file))
            (rules  (plist-get (cdr spec) :rules)))
        (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 (and buffer (apply #'doom-popup-buffer buffer rules) (not any-p))
          (setq any-p t))))
    (when any-p

only close popups that have an :autoclose property in their rule (see
`shackle-rules')."
  (interactive)
  (when-let (popups (doom-popup-windows))
    (let ((orig-win (selected-window))
          doom-popup-remember-history)
      (setq doom-popup-history (mapcar #'doom--popup-data popups))
      (dolist (window popups)
        (when (or force-p
                  (called-interactively-p 'interactive)
                  (doom-popup-prop :autoclose window))
          (delete-window window))))))

;;;###autoload
(defun doom/popup-close-maybe ()
  "Close the current popup *if* its window doesn't have a noesc parameter."
  (interactive)
  (if (doom-popup-prop :noesc)
      (call-interactively
       (if (featurep 'evil)
           #'evil-force-normal-state
         #'keyboard-escape-quit))
    (delete-window)))

;;;###autoload
(defun doom/popup ()
  "Display currently selected buffer in a popup window."
  (interactive)
  (doom-popup-buffer (current-buffer) :align t :autokill t))

;;;###autoload
(defun doom/popup-toggle-messages ()
