Function: eca-table--beautify-at-point
eca-table--beautify-at-point is a natively compiled function defined
in eca-table.el.
Signature
(eca-table--beautify-at-point)
Documentation
Apply visual overlays to the markdown table at point.
Point must be inside a table. Adds header highlighting, dims the separator row and pipe characters, and applies zebra striping to data rows. For tables wider than the window, an action bar is shown allowing the user to toggle between wrapped and scrollable display. All changes are overlay-only — buffer text is untouched.
Source Code
;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-table.el
(defun eca-table--beautify-at-point ()
"Apply visual overlays to the markdown table at point.
Point must be inside a table. Adds header highlighting, dims the
separator row and pipe characters, and applies zebra striping to
data rows. For tables wider than the window, an action bar is shown
allowing the user to toggle between wrapped and scrollable display.
All changes are overlay-only — buffer text is untouched."
(let* ((tbl-beg (markdown-table-begin))
(tbl-end (markdown-table-end))
(row-num 0)
(max-width (eca-table--max-line-width tbl-beg tbl-end))
(window-width (when-let* ((win (get-buffer-window (current-buffer))))
(window-body-width win)))
(wide-p (and window-width (> max-width window-width))))
;; Clean any previous overlays in this table region
(eca-table-remove-overlays tbl-beg tbl-end)
;; Add action bar for wide tables
(if wide-p
(let ((action-ov (make-overlay tbl-beg tbl-end)))
(overlay-put action-ov 'eca-table-overlay t)
(overlay-put action-ov 'eca-table-action t)
(overlay-put action-ov 'eca-table-truncated nil)
;; `eca-table-actions-map' binds w (wrap) and o (open).
(overlay-put action-ov 'keymap eca-table-actions-map)
(overlay-put action-ov 'evaporate t)
(eca-table--refresh-action-bar action-ov))
;; Narrower tables get no action bar, but still bind `o' so the
;; table can be opened in its own buffer from anywhere on it.
(let ((open-ov (make-overlay tbl-beg tbl-end)))
(overlay-put open-ov 'eca-table-overlay t)
(overlay-put open-ov 'keymap eca-table-open-map)
(overlay-put open-ov 'evaporate t)))
(save-excursion
(goto-char tbl-beg)
(while (< (point) tbl-end)
(let ((line-beg (line-beginning-position))
(line-end (line-end-position)))
(cond
;; Row 0: header row
((= row-num 0)
(let ((ov (make-overlay line-beg (1+ line-end))))
(overlay-put ov 'eca-table-overlay t)
(overlay-put ov 'face 'eca-table-header-face)
(overlay-put ov 'evaporate t)))
;; Row 1: separator row (|---|---|)
((= row-num 1)
(let ((ov (make-overlay line-beg (1+ line-end))))
(overlay-put ov 'eca-table-overlay t)
(overlay-put ov 'face 'eca-table-separator-face)
(overlay-put ov 'evaporate t)))
;; Data rows: zebra stripe even rows (row 2 = first data row = even)
(t
(when (cl-evenp row-num)
(let ((ov (make-overlay line-beg (1+ line-end))))
(overlay-put ov 'eca-table-overlay t)
(overlay-put ov 'face 'eca-table-row-even-face)
(overlay-put ov 'evaporate t)))))
;; Dim pipe characters on this line
(save-excursion
(goto-char line-beg)
(while (search-forward "|" line-end t)
(let ((ov (make-overlay (1- (point)) (point))))
(overlay-put ov 'eca-table-overlay t)
(overlay-put ov 'face 'eca-table-pipe-face)
(overlay-put ov 'evaporate t)))))
(setq row-num (1+ row-num))
(forward-line 1)))))