Function: ses-center

ses-center is a byte-compiled function defined in ses.el.gz.

Signature

(ses-center VALUE &optional SPAN FILL PRINTER)

Documentation

Print VALUE, centered within column.

FILL is the fill character for centering (default = space). SPAN indicates how many additional rightward columns to include in width (default = 0). PRINTER is the printer to use for printing the value, default is the column printer if any, or the spreadsheet default printer otherwise.

Source Code

;; Defined in /usr/src/emacs/lisp/ses.el.gz
;;----------------------------------------------------------------------------
;; Standard print functions
;;----------------------------------------------------------------------------

(defun ses-center (value &optional span fill printer)
  "Print VALUE, centered within column.
FILL is the fill character for centering (default = space).
SPAN indicates how many additional rightward columns to include in
width (default = 0).
PRINTER is the printer to use for printing the value, default is the
column printer if any, or the spreadsheet default printer otherwise."
  (ses--align value
              (lambda (value width fill)
                (if (<= width 0)
                    value ; Too large for field, anyway.
                  (let ((half (make-string (/ width 2) fill)))
                    (concat half value half
                            (if (oddp width) (char-to-string fill))))))
              span (or fill ?\s) printer))