Function: org-table-paste-rectangle

org-table-paste-rectangle is an autoloaded, interactive and byte-compiled function defined in org-table.el.gz.

Signature

(org-table-paste-rectangle)

Documentation

Paste a rectangular region into a table.

The upper right corner ends up in the current field. All involved fields will be overwritten. If the rectangle does not fit into the present table, the table is enlarged as needed. The process ignores horizontal separator lines.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
;;;###autoload
(defun org-table-paste-rectangle ()
  "Paste a rectangular region into a table.
The upper right corner ends up in the current field.  All involved fields
will be overwritten.  If the rectangle does not fit into the present table,
the table is enlarged as needed.  The process ignores horizontal separator
lines."
  (interactive)
  (unless (consp org-table-clip)
    (user-error "First cut/copy a region to paste!"))
  (org-table-check-inside-data-field)
  (let* ((column (org-table-current-column))
	 (org-table-automatic-realign nil))
    (org-table-save-field
     (dolist (row org-table-clip)
       (while (org-at-table-hline-p) (forward-line))
       ;; If we left the table, create a new row.
       (when (and (bolp) (not (looking-at "[ \t]*|")))
	 (end-of-line 0)
	 (org-table-next-field))
       (let ((c column))
	 (dolist (field row)
	   (org-table-goto-column c nil 'force)
	   (org-table-get-field nil field)
	   (cl-incf c)))
       (forward-line)))
    (org-table-align)))