Function: eca-table-open
eca-table-open is an interactive and natively compiled function
defined in eca-table.el.
Signature
(eca-table-open &optional EVENT)
Documentation
Open the markdown table at point (or clicked) in a dedicated buffer.
The table is shown aligned in a *eca-table* buffer with
truncate-lines enabled, so horizontal scrolling keeps the header
aligned with the body and you can search or copy the whole table
freely. The chat buffer is not modified. EVENT, when non-nil, is
the mouse click on the action bar.
Key Bindings
eca-table-actions-map o eca-table-open-map o
Source Code
;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-table.el
(defun eca-table-open (&optional event)
"Open the markdown table at point (or clicked) in a dedicated buffer.
The table is shown aligned in a `*eca-table*' buffer with
`truncate-lines' enabled, so horizontal scrolling keeps the header
aligned with the body and you can search or copy the whole table
freely. The chat buffer is not modified. EVENT, when non-nil, is
the mouse click on the action bar."
(interactive (list last-command-event))
(let ((pos (if (mouse-event-p event)
(posn-point (event-start event))
(point)))
(beg nil)
(end nil))
(save-excursion
(when pos (goto-char pos))
(let ((ov (seq-find (lambda (o) (overlay-get o 'eca-table-action))
(overlays-at (point)))))
(cond
(ov (setq beg (overlay-start ov) end (overlay-end ov)))
((markdown-table-at-point-p)
(setq beg (markdown-table-begin) end (markdown-table-end))))))
(unless (and beg end)
(user-error "Point is not on a markdown table"))
(let ((text (buffer-substring-no-properties beg end))
(buf (get-buffer-create "*eca-table*")))
(with-current-buffer buf
(let ((inhibit-read-only t))
(erase-buffer)
(gfm-mode)
(setq-local markdown-hide-markup t)
(eca-table--apply-markdown-markup-visibility)
(setq-local markdown-fontify-code-blocks-natively t)
(face-remap-add-relative 'markdown-table-face '(:inherit fixed-pitch))
(insert text)
(unless (bolp) (insert "\n"))
(goto-char (point-min))
(when (markdown-table-at-point-p)
(markdown-table-align)
(eca-table--align-at-point))
(font-lock-ensure)
(goto-char (point-min)))
(setq-local truncate-lines t)
(setq buffer-read-only t))
(pop-to-buffer buf))))