Wrapping my brain around using #org-mode as a spreadsheet. Is there a way to pass a range of cells as a vector to a custom function? Ideally, I'd like to embed this function into the file itself. #emacs
That shows you how to define a column formula with elisp. I think think usual "vsum" and friends are vector operations from the emacs calculator, so it seems very likely?
I gotta go to the bike shop, but my heuristic would be:
1. I know vsum works in org-mode spreadsheet formulas 2. I know the v stands for "vector" 3. Can I use that function's source to define my own vector operations?
I like to think the answer is YES. I am hopeful at least.
@Shae Erisson So, of appears that I can pass simple (single cell) references into raw elisp functions, but not ranges. I'll have to have a closer look at vsum as mentioned earlier to see if there's a solution there.
I would be interested if you manage to read org tables as lisp lists. I haven't tried it yet, but I plan to do it occasionally, so cfw would get an org-table import/export. Currently it can do CSV.
Shae Erisson
in reply to Jonathan Lamothe • • •I WANT TO SHOW YOU MY TOYS!
I just did my 2024 taxes in org-mode spreadsheets!
Jonathan Lamothe
in reply to Shae Erisson • •Shae Erisson
in reply to Jonathan Lamothe • • •Yeah, I'd love to show you! I keep meaning to write a blog post.
In summary, table references are updated when that table's cells are reordered.
If another table refers to a cell in this table, that reference is not updated when the cell moves.
You can name a field! I was able to decipher this confusing illustration after an hour of staring: orgmode.org/org.html#Advanced-…
I'd already decided to do each tax form as its own spreadsheet: gist.github.com/shapr/84e37fdf…
Does the gist help?
A snippet of my taxes done in org-mode spreadsheets
GistShae Erisson
in reply to Jonathan Lamothe • • •Ahem, sorry about that excitement explosion.
Yes, you can call elisp functions, um, lemme find the reference
Shae Erisson
in reply to Jonathan Lamothe • • •Oh, as a vector? 🤔
Gosh I don't know about that.
orgmode.org/worg/org-tutorials…
That shows you how to define a column formula with elisp. I think think usual "vsum" and friends are vector operations from the emacs calculator, so it seems very likely?
Org as a spreadsheet system: a short introduction
orgmode.orgJonathan Lamothe
in reply to Shae Erisson • •Shae Erisson
in reply to Jonathan Lamothe • • •I gotta go to the bike shop, but my heuristic would be:
1. I know vsum works in org-mode spreadsheet formulas
2. I know the v stands for "vector"
3. Can I use that function's source to define my own vector operations?
I like to think the answer is YES. I am hopeful at least.
Jonathan Lamothe
in reply to Shae Erisson • •vsum
to see how it works. Internally it'scalcFunc-vsum
right?Shae Erisson
in reply to Jonathan Lamothe • • •Jonathan Lamothe
in reply to Shae Erisson • •org-table-get-*
functions are showing some promise.Jonathan Lamothe
in reply to Shae Erisson • •vsum
as mentioned earlier to see if there's a solution there.Jonathan Lamothe
in reply to Jonathan Lamothe • •Shae Erisson
in reply to Jonathan Lamothe • • •I don't understand pivot tables, so I can't help.
What would this look like?
Jonathan Lamothe
in reply to Shae Erisson • •hajovonta
in reply to Jonathan Lamothe • • •Nice! I recently added pivottable functionality to #cfw but I don't think it would help you here.
It is since complete with transient menus and drilldown.
hajovonta
in reply to hajovonta • • •Jonathan Lamothe
in reply to hajovonta • •org-table-as-lisp
.Linus
in reply to Jonathan Lamothe • • •