Function: hycontrol-windows-grid-minimum-size

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

Signature

(hycontrol-windows-grid-minimum-size NUM-BUFFERS)

Documentation

Return the minimum integer window grid size to display abs(NUM-BUFFERS).

Minimize number of rows rather than columns. Size is a 2 digit whole number with the first digit number of rows and the second, number of columns of windows. Return 0 if NUM-BUFFERS is 0.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hycontrol.el
(defun hycontrol-windows-grid-minimum-size (num-buffers)
  "Return the minimum integer window grid size to display abs(NUM-BUFFERS).
Minimize number of rows rather than columns.  Size is a 2 digit
whole number with the first digit number of rows and the second,
number of columns of windows.  Return 0 if NUM-BUFFERS is 0."
  (if (integerp num-buffers)
      (let* ((num-cols (ceiling (sqrt num-buffers)))
	     (num-rows (max (1- num-cols) 0))
	     (grid-size (+ (* num-rows 10) num-cols)))
	(when (< (* num-rows num-cols) num-buffers)
	  (setq grid-size (+ 10 grid-size)))
	grid-size)
    (error "(hycontrol-windows-grid-minimum-size): 'num-buffers' must be an integer, not '%s'" num-buffers)))