Function: smart-coords-in-window-p

smart-coords-in-window-p is a byte-compiled function defined in hui-window.el.

Signature

(smart-coords-in-window-p COORDS WINDOW)

Documentation

Test if COORDS are in WINDOW. Return WINDOW if they are, nil otherwise.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-window.el
(defun smart-coords-in-window-p (coords window)
  "Test if COORDS are in WINDOW.  Return WINDOW if they are, nil otherwise."
  (cond ((null coords) nil)
	((eventp coords)
	 (let ((w-or-f (posn-window (event-start coords))))
	   (when (framep w-or-f)
	     (setq w-or-f (frame-selected-window w-or-f)))
	   (when (and (eq w-or-f window) (window-valid-p window))
	     window)))
	(t
	 (let* ((edges (window-edges window))
		(w-xmin (nth 0 edges))
		(w-ymin (nth 1 edges))
		(w-xmax (nth 2 edges))
		(w-ymax (nth 3 edges))
		(x  (hmouse-x-coord coords))
		(y  (hmouse-y-coord coords)))
	   (and (<= w-xmin x) (<= x w-xmax)
		(<= w-ymin y) (<= y w-ymax)
		(window-valid-p window)
		window)))))