Function: table-heighten-cell
table-heighten-cell is an autoloaded, interactive and byte-compiled
function defined in table.el.gz.
Signature
(table-heighten-cell N &optional NO-COPY NO-UPDATE)
Documentation
Heighten the current cell by N lines by expanding the cell vertically.
Heightening is done by adding blank lines at the bottom of the current cell. Other cells aligned horizontally with the current one are also heightened in order to keep the rectangular table structure. The optional argument NO-COPY is internal use only and must not be specified.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/table.el.gz
;;;###autoload
(defun table-heighten-cell (n &optional no-copy no-update)
"Heighten the current cell by N lines by expanding the cell vertically.
Heightening is done by adding blank lines at the bottom of the current
cell. Other cells aligned horizontally with the current one are also
heightened in order to keep the rectangular table structure. The
optional argument NO-COPY is internal use only and must not be
specified."
(interactive "*p")
(if (< n 0) (setq n 1))
(let* ((coord-list (table--cell-list-to-coord-list (table--horizontal-cell-list t)))
(left-list nil)
(this-list coord-list)
(right-list (cdr coord-list))
(bottom-border-y (1+ (cdr (table--get-coordinate (cdr (table--vertical-cell-list nil t))))))
(vertical-str (string table-cell-vertical-char))
(vertical-str-with-properties (string table-cell-vertical-char))
(first-time t)
(current-coordinate (table--get-coordinate)))
;; prepare the right vertical string with appropriate properties put
(table--put-cell-keymap-property 0 (length vertical-str-with-properties) vertical-str-with-properties)
;; create the space below for the table to grow
(table--create-growing-space-below n coord-list bottom-border-y)
;; vertically expand each cell from left to right
(while this-list
(let* ((left (prog1 (car left-list) (setq left-list (if left-list (cdr left-list) coord-list))))
(this (prog1 (car this-list) (setq this-list (cdr this-list))))
(right (prog1 (car right-list) (setq right-list (cdr right-list))))
(exclude-left (and left (< (cddr left) (cddr this))))
(exclude-right (and right (<= (cddr right) (cddr this))))
(beg (table--goto-coordinate
(cons (if exclude-left (caar this) (1- (caar this)))
(1+ (cddr this)))))
(end (table--goto-coordinate
(cons (if exclude-right (cadr this) (1+ (cadr this)))
bottom-border-y)))
(rect (extract-rectangle beg end)))
;; prepend blank cell lines to the extracted rectangle
(let ((i n))
(while (> i 0)
(setq rect (cons
(concat (if exclude-left ""
(if first-time vertical-str vertical-str-with-properties))
(table--cell-blank-str (- (cadr this) (caar this)))
(if exclude-right "" vertical-str-with-properties))
rect))
(setq i (1- i))))
(setq first-time nil)
(delete-rectangle beg end)
(goto-char beg)
(table--insert-rectangle rect)))
(table--goto-coordinate current-coordinate)
;; re-recognize the current cell's new dimension
(table-recognize-cell 'force no-copy)
(unless no-update
(table--update-cell-heightened))))