From bdef6c6252fda71a7307eb443d30491cbdbfd543 Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Sat, 12 Aug 2023 13:44:33 -0800 Subject: [PATCH] Function to properly find frame object from some name it's had --- notibox.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/notibox.el b/notibox.el index 3c2b09a..3dcf1fc 100644 --- a/notibox.el +++ b/notibox.el @@ -114,6 +114,19 @@ If STACKDEPTH is non-nil and nonzero, return a position that far down." (notibox--show :timeout (unless timeout alert-fade-time) :depth (or depth (- (length notibox-current-posframes) 1))))) +(defun notibox--resolve-frame (object) + "Return the /frame reference/ signified by OBJECT, whatever it may be." + (cond + ((framep object) object) ;this is the easy one + ((windowp object) (window-frame object)) + ((bufferp object) (window-frame (get-window-buffer object))) + ((stringp object) + (window-frame (get-buffer-window (get-buffer object)))) + ((symbolp object) + (window-frame (get-buffer-window (get-buffer (format "%s" object))))) + )) +;; (notibox--resolve-frame "*notibox*") + (defun notibox--hide (frame) "Stop showing FRAME." (posframe-hide (window-buffer (frame-selected-window frame))))