Function: hycontrol-windows-grid-validate

hycontrol-windows-grid-validate is a byte-compiled function defined in hycontrol.el.

Signature

(hycontrol-windows-grid-validate ARG)

Documentation

Return the closest valid windows grid size from the two digit numeric abs(ARG).

The digits of ARG specify the number of rows (leftmost) by columns (rightmost) for a grid.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hycontrol.el
(defun hycontrol-windows-grid-validate (arg)
  "Return the closest valid windows grid size from the two digit numeric abs(ARG).
The digits of ARG specify the number of rows (leftmost) by
columns (rightmost) for a grid."
  (if (integerp arg)
      (let* ((grid-size (abs arg))
	     (rows (floor (/ grid-size 10)))
	     (columns (- grid-size (* rows 10))))
	(cond ((<= grid-size 10)
	       (hycontrol-windows-grid-minimum-size grid-size))
	      ((> grid-size 99)
	       99)
	      ((zerop columns)
	       (hycontrol-windows-grid-minimum-size (* rows columns)))
	      (t grid-size)))
    (error "(hycontrol-windows-grid-validate): 'arg' must be an integer, not '%s'" arg)))