Function: org-table-end

org-table-end is an autoloaded and byte-compiled function defined in org-table.el.gz.

Signature

(org-table-end &optional TABLE-TYPE)

Documentation

Find the end of the table and return its position.

With a non-nil optional argument TABLE-TYPE, return the end of a table.el-type table. This function assumes point is on a table.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
;;;###autoload
(defun org-table-end (&optional table-type)
  "Find the end of the table and return its position.
With a non-nil optional argument TABLE-TYPE, return the end of
a table.el-type table.  This function assumes point is on
a table."
  (save-excursion
    (cond (table-type
	   (goto-char (org-element-property :end (org-element-at-point)))
	   (skip-chars-backward " \t\n")
	   (line-beginning-position 2))
	  ((re-search-forward org-table-border-regexp nil t)
	   (match-beginning 0))
	  ;; When the line right after the table is the last line in
	  ;; the buffer with trailing spaces but no final newline
	  ;; character, be sure to catch the correct ending at its
	  ;; beginning.  In any other case, ending is expected to be
	  ;; at point max.
	  (t (goto-char (point-max))
	     (skip-chars-backward " \t")
	     (if (bolp) (point) (line-end-position))))))