Function: table--create-growing-space-below
table--create-growing-space-below is a byte-compiled function defined
in table.el.gz.
Signature
(table--create-growing-space-below LINES-TO-EXTEND LEFT-TO-RIGHT-COORD-LIST BOTTOM-BORDER-Y)
Documentation
Create growing space below the table.
This function creates growing space below the table slightly
intelligent fashion. Following is the cases it handles for each
growing line:
1. When the first line below the table is a complete blank line it
inserts a blank line.
2. When the line starts with a prefix that matches the prefix of the
bottom line of the table it inserts a line consisting of prefix alone.
3. Otherwise it deletes the rectangular contents where table will
grow into.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/table.el.gz
(defun table--create-growing-space-below (lines-to-extend left-to-right-coord-list bottom-border-y)
"Create growing space below the table.
This function creates growing space below the table slightly
intelligent fashion. Following is the cases it handles for each
growing line:
1. When the first line below the table is a complete blank line it
inserts a blank line.
2. When the line starts with a prefix that matches the prefix of the
bottom line of the table it inserts a line consisting of prefix alone.
3. Otherwise it deletes the rectangular contents where table will
grow into."
(save-excursion
(let ((i 0)
(prefix (and (table--goto-coordinate (cons 0 bottom-border-y))
(re-search-forward
".*\\S "
(save-excursion
(table--goto-coordinate
(cons (1- (caar (car left-to-right-coord-list))) bottom-border-y)))
t)
(buffer-substring (match-beginning 0) (match-end 0)))))
(while (< i lines-to-extend)
(let ((y (+ i bottom-border-y 1)))
(table--goto-coordinate (cons 0 y))
(cond
((looking-at "\\s *$")
(insert ?\n))
((and prefix (looking-at (concat (regexp-quote prefix) "\\s *$")))
(insert prefix ?\n))
(t
(delete-rectangle
(table--goto-coordinate (cons (1- (caar (car left-to-right-coord-list))) y))
(table--goto-coordinate (cons (1+ (cadr (car (last left-to-right-coord-list)))) y))))))
(setq i (1+ i))))))