Function: table--find-row-column

table--find-row-column is a byte-compiled function defined in table.el.gz.

Signature

(table--find-row-column &optional COLUMNP NO-ERROR)

Documentation

Search table and return a cell coordinate list of row or column.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/table.el.gz
(defun table--find-row-column (&optional columnp no-error)
  "Search table and return a cell coordinate list of row or column."
  (let ((current-coordinate (table--get-coordinate)))
    (catch 'end
      (catch 'error
	(let ((coord (table--get-coordinate)))
	  (while
	      (progn
		(if columnp (setcar coord (1- (car coord)))
		  (setcdr coord (1- (cdr coord))))
		(>= (if columnp (car coord) (cdr coord)) 0))
	    (while (progn
		     (table--goto-coordinate coord 'no-extension 'no-tab-expansion)
		     (not (looking-at (format "[%s%c%c]"
					      table-cell-horizontal-chars
					      table-cell-vertical-char
					      table-cell-intersection-char))))
	      (if columnp (setcar coord (1- (car coord)))
		(setcdr coord (1- (cdr coord))))
	      (if (< (if columnp (car coord) (cdr coord)) 0)
		  (throw 'error nil)))
	    (if (table--probe-cell)
		(throw 'end (table--cell-list-to-coord-list (if columnp
								(table--vertical-cell-list t nil 'left)
							      (table--horizontal-cell-list t nil 'top))))
	      (table--goto-coordinate (table--offset-coordinate coord (if columnp '(0 . 1) '(1 . 0)))
				      'no-extension 'no-tab-expansion)
	      (if (table--probe-cell)
		  (throw 'end (table--cell-list-to-coord-list (if columnp
								  (table--vertical-cell-list t nil 'left)
								(table--horizontal-cell-list t nil 'top)))))))))
      (table--goto-coordinate current-coordinate)
      (if no-error nil
	(error "Table not found")))))