Skip to main content


Fine, I'll build an #emacs pivot table package for #org-mode.

reshared this

in reply to Jonathan Lamothe

I've run into a snag.

I have a function, pivot-table-get-columns (shorthanded as pt-get-columns). Its job is to take an #OrgMode table and produce an alist of mappings of column names to column numbers. The column names are as defined by section 3.5.10 of the org-mode manual.

My code is here.

When I pass this function a table without column labels, it crashes on the format line (which it shouldn't even be reaching).

Can someone explain to me what I'm doing wrong?

(cc: @screwlisp )

#emacs #elisp

Edit: I've been beating my head against a wall for some time on this getting nowhere and less than a minute after asking this, I see it. My first unless should be a when. I'll fix it later.

reshared this

in reply to Jonathan Lamothe

actually, I'm unaware of

(setq result (((format "%s" cell) . n) . result))

being a permissable form. It looks like

(setq result `((,(format "%s" cell) . ,n) . ,result))

to me but I might be wrong. Does it fix the problem or did you have another insight?

This entry was edited (6 hours ago)
in reply to screwlisp

Another thing is that you've used eq. Those strings aren't ever going to be eq which means "literally the same thing". You probably meant equal.
in reply to screwlisp

very cool to see you doing this elisp! By the way, I am a total convert to eev-mode and eepitch.
in reply to screwlisp

what does org table source look like by the way? I normally pass org tables into org source blocks (where they become s-expressions in lisp), but I'm not sure what the tables look like internally to org.
in reply to screwlisp

further about eq in common lisp at least, I've seen people make a mistake before- when you compile code, if you referred to "" twice, in common lisp compilers are allowed to coalesce them at which point they /will/ be eq. (Eq would be a good test to see if they /had/ been coalesced). But in the general case two strings entered in different places are not eq.
in reply to hajovonta

humor

Sensitive content

This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.