tumashu / posframe

Pop a posframe (just a child-frame) at point, posframe is a **GNU ELPA** package!
454 stars 58 forks source link

Function to move posframe? #142

Open jcs090218 opened 5 months ago

jcs090218 commented 5 months ago

Hi,

Is there a function that could move the posframe after creation? 🤔 If not, would you consider this a feature request?

Thanks!

tumashu commented 5 months ago

posframe has a helper function, maybe useful. posframe just frame, and store in posframe--frame after it created.

(defun posframe-funcall (buffer-or-name function &rest arguments)
  "Select posframe of BUFFER-OR-NAME and call FUNCTION with ARGUMENTS.
BUFFER-OR-NAME can be a buffer or a buffer name."
  (when (functionp function)
    (when (get-buffer buffer-or-name)
      (with-current-buffer buffer-or-name
        (when (framep posframe--frame)
          (with-selected-frame posframe--frame
            (apply function arguments)))))))