Function: org-table--force-dataline

org-table--force-dataline is a byte-compiled function defined in org-table.el.gz.

Signature

(org-table--force-dataline)

Documentation

Move point to the closest data line in a table.

Raise an error if the table contains no data line. Preserve column when moving point.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
(defun org-table--force-dataline ()
  "Move point to the closest data line in a table.
Raise an error if the table contains no data line.  Preserve
column when moving point."
  (unless (org-match-line org-table-dataline-regexp)
    (let* ((re org-table-dataline-regexp)
	   (column (current-column))
	   (p1 (save-excursion (re-search-forward re (org-table-end) t)))
	   (p2 (save-excursion (re-search-backward re (org-table-begin) t))))
      (cond ((and p1 p2)
	     (goto-char (if (< (abs (- p1 (point))) (abs (- p2 (point))))
			    p1
			  p2)))
	    ((or p1 p2) (goto-char (or p1 p2)))
	    (t (user-error "No table data line around here")))
      (org-move-to-column column))))