Function: hydra--cell

hydra--cell is a byte-compiled function defined in hydra.el.

Signature

(hydra--cell FSTR NAMES)

Documentation

Format a rectangular cell based on FSTR and NAMES.

FSTR is a format-style string with two string inputs: one for the doc and one for the symbol name. NAMES is a list of variables.

Source Code

;; Defined in ~/.emacs.d/elpa/hydra-20250316.1254/hydra.el
(defun hydra--cell (fstr names)
  "Format a rectangular cell based on FSTR and NAMES.
FSTR is a format-style string with two string inputs: one for the
doc and one for the symbol name.
NAMES is a list of variables."
  (let ((len (cl-reduce
              (lambda (acc it) (max (length (symbol-name it)) acc))
              names
              :initial-value 0)))
    (mapconcat
     (lambda (sym)
       (if sym
           (format fstr
                   (documentation-property sym 'variable-documentation)
                   (let ((name (symbol-name sym)))
                     (concat name (make-string (- len (length name)) ?^)))
                   sym)
         ""))
     names
     "\n")))