I'd like to write a mode, or at least some Lisp functions, to view a tab-separated file like a table. What I mean is lines like this:
foo\t123\tbar
yabba dabba\t12345\treally long field here
Should display something like:
| foo | 123 | bar |
| yabba dabba| 12345 | really long... |
Fields would line up, and long fields could be truncated. I might hide certain columns. I want to use it for viewing log files.
I'm searching the Emacs Lisp manual for ways to implement this. So far I see
- text property
'(invisible t)
, which could be used to truncate some fields - overlays and the overlay properties
before-string
andafter-string
, which I could use to add padding to fields, or draw separators
Is this how you would do it? Are there some other features and functions that would be good to use?