Function: table--vertical-cell-list

table--vertical-cell-list is a byte-compiled function defined in table.el.gz.

Signature

(table--vertical-cell-list &optional TOP-TO-BOTTOM FIRST-ONLY PIVOT INTERNAL-DIR INTERNAL-LIST INTERNAL-PX)

Documentation

Return a vertical cell list from the table.

The return value represents a list of cells including the current cell that align vertically. Each element of the list is a cons cell (lu
. rb) where lu is the cell's left upper location and rb is the cell's
right bottom location. The cell order in the list is from bottom to top of the table. If optional argument TOP-TO-BOTTOM is non-nil the order is reversed as from top to bottom of the table. If optional argument FIRST-ONLY is non-nil the return value is not a list of cells but a single cons cell that is the first cell of the list, if the list had been created. If optional argument PIVOT is a symbol left the vertical cell search is aligned with the left edge of the current cell, otherwise aligned with the right edge of the current cell. The arguments INTERNAL-DIR, INTERNAL-LIST and INTERNAL-PX are internal use only and must not be specified.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/table.el.gz
(defun table--vertical-cell-list (&optional top-to-bottom first-only pivot internal-dir internal-list internal-px)
  "Return a vertical cell list from the table.
The return value represents a list of cells including the current cell
that align vertically.  Each element of the list is a cons cell (lu
. rb) where lu is the cell's left upper location and rb is the cell's
right bottom location.  The cell order in the list is from bottom to
top of the table.  If optional argument TOP-TO-BOTTOM is non-nil the
order is reversed as from top to bottom of the table.  If optional
argument FIRST-ONLY is non-nil the return value is not a list of cells
but a single cons cell that is the first cell of the list, if the list
had been created.  If optional argument PIVOT is a symbol `left' the
vertical cell search is aligned with the left edge of the current
cell, otherwise aligned with the right edge of the current cell.  The
arguments INTERNAL-DIR, INTERNAL-LIST and INTERNAL-PX are internal use
only and must not be specified."
  (save-excursion
    (let* ((cell (table--probe-cell))
	   (lu-coordinate (table--get-coordinate (car cell)))
	   (rb-coordinate (table--get-coordinate (cdr cell)))
	   (px (or internal-px (car (if (eq pivot 'left) lu-coordinate rb-coordinate))))
	   (ty (- (cdr lu-coordinate) 2))
	   (by (+ (cdr rb-coordinate) 2)))
      ;; in case of finding the first cell, get the last adding item on the list
      (if (and (null internal-dir) first-only) (setq top-to-bottom (null top-to-bottom)))
      ;; travel up and process as recursion traces back (reverse order)
      (and cell
	   (or (eq internal-dir 'up) (null internal-dir))
	   (table--goto-coordinate (cons px (if top-to-bottom by ty)) 'no-extension 'no-tab-expansion)
	   (setq internal-list (table--vertical-cell-list top-to-bottom first-only nil 'up nil px)))
      ;; return the last cell or add this cell to the list
      (if first-only (or internal-list cell)
	(setq internal-list (if cell (cons cell internal-list) internal-list))
	;; travel down and process as entering each recursion (forward order)
	(and cell
	     (or (eq internal-dir 'down) (null internal-dir))
	     (table--goto-coordinate (cons px (if top-to-bottom ty by)) 'no-extension 'no-tab-expansion)
	     (setq internal-list (table--vertical-cell-list top-to-bottom nil nil 'down internal-list px)))
	;; return the result
	internal-list))))