Function: org-table-insert-row
org-table-insert-row is an autoloaded, interactive and byte-compiled
function defined in org-table.el.gz.
Signature
(org-table-insert-row &optional ARG)
Documentation
Insert a new row above the current line into the table.
With prefix ARG, insert below the current line.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
;;;###autoload
(defun org-table-insert-row (&optional arg)
"Insert a new row above the current line into the table.
With prefix ARG, insert below the current line."
(interactive "P")
(unless (org-at-table-p) (user-error "Not at a table"))
(org-table-with-shrunk-columns
(let* ((line (buffer-substring (line-beginning-position) (line-end-position)))
(new (org-table-clean-line line)))
;; Fix the first field if necessary
(when (string-match "^[ \t]*| *[#*$] *|" line)
(setq new (replace-match (match-string 0 line) t t new)))
(beginning-of-line (if arg 2 1))
;; Buffer may not end of a newline character, so ensure
;; (beginning-of-line 2) moves point to a new line.
(unless (bolp) (insert "\n"))
(let (org-table-may-need-update) (insert-before-markers new "\n"))
(beginning-of-line 0)
(re-search-forward "| ?" (line-end-position) t)
(when (or org-table-may-need-update org-table-overlay-coordinates)
(org-table-align))
(when (or (not org-table-fix-formulas-confirm)
(funcall org-table-fix-formulas-confirm "Fix formulas? "))
(org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1)))))