Function: org-table-goto-column

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

Signature

(org-table-goto-column N &optional ON-DELIM FORCE)

Documentation

Move the cursor to the Nth column in the current table line.

With optional argument ON-DELIM, stop with point before the left delimiter of the field. If there are less than N fields, just go to after the last delimiter. However, when FORCE is non-nil, create new columns if necessary.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-table.el.gz
;;;###autoload
(defun org-table-goto-column (n &optional on-delim force)
  "Move the cursor to the Nth column in the current table line.
With optional argument ON-DELIM, stop with point before the left delimiter
of the field.
If there are less than N fields, just go to after the last delimiter.
However, when FORCE is non-nil, create new columns if necessary."
  (interactive "p")
  (forward-line 0)
  (when (> n 0)
    (while (and (> (setq n (1- n)) -1)
                (or (search-forward "|" (line-end-position) t)
		    (and force
			 (progn (end-of-line 1)
				(skip-chars-backward "^|")
				(insert " | ")
				t)))))
    (when (and force (not (looking-at ".*|")))
      (save-excursion (end-of-line 1) (insert " | ")))
    (if on-delim
	(backward-char 1)
      (if (looking-at " ") (forward-char 1)))))