Function: table--horizontal-cell-list
table--horizontal-cell-list is a byte-compiled function defined in
table.el.gz.
Signature
(table--horizontal-cell-list &optional LEFT-TO-RIGHT FIRST-ONLY PIVOT INTERNAL-DIR INTERNAL-LIST INTERNAL-PY)
Documentation
Return a horizontal cell list from the table.
The return value represents a list of cells including the current cell
that align horizontally. Each element of the list is a cons cells (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 right to
left of the table. If optional argument LEFT-TO-RIGHT is non-nil the
order is reversed as from left to right 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 top
the horizontal cell search is aligned with the top edge of the current
cell, otherwise aligned with the bottom edge of the current cell. The
arguments INTERNAL-DIR, INTERNAL-LIST and INTERNAL-PY are internal use
only and must not be specified.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/table.el.gz
(defun table--horizontal-cell-list (&optional left-to-right first-only pivot internal-dir internal-list internal-py)
"Return a horizontal cell list from the table.
The return value represents a list of cells including the current cell
that align horizontally. Each element of the list is a cons cells (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 right to
left of the table. If optional argument LEFT-TO-RIGHT is non-nil the
order is reversed as from left to right 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 `top'
the horizontal cell search is aligned with the top edge of the current
cell, otherwise aligned with the bottom edge of the current cell. The
arguments INTERNAL-DIR, INTERNAL-LIST and INTERNAL-PY 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)))
(py (or internal-py (if (eq pivot 'top) (cdr lu-coordinate) (1+ (cdr rb-coordinate)))))
(lx (1- (car lu-coordinate)))
(rx (1+ (car rb-coordinate))))
;; in case of finding the first cell, get the last adding item on the list
(if (and (null internal-dir) first-only) (setq left-to-right (null left-to-right)))
;; travel left and process as recursion traces back (reverse order)
(and cell
(or (eq internal-dir 'left) (null internal-dir))
(table--goto-coordinate (cons (if left-to-right rx lx) py) 'no-extension 'no-tab-expansion)
(setq internal-list (table--horizontal-cell-list left-to-right first-only nil 'left nil py)))
;; 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 right and process as entering each recursion (forward order)
(and cell
(or (eq internal-dir 'right) (null internal-dir))
(table--goto-coordinate (cons (if left-to-right lx rx) py) 'no-extension 'no-tab-expansion)
(setq internal-list (table--horizontal-cell-list left-to-right nil nil 'right internal-list py)))
;; return the result
internal-list))))