literate-calc-mode.el
literate-calc-mode.el copied to clipboard
Wishes Really
-
After an insert into buffer, would be nice to have a command to clear the results (i.e., the => stuff) and allow revision, and if a region is active limit the clearing to the region.
-
Unless you're constrained by calc, allow variable names to have digits in them, e.g., Price1, Price2, and perhaps underscores, Price_1 and Price_2
-
Allow variables from lines with inserted results to continue to participate in calculations, now they seem to be "deactivated."
-
Real kick-ass addition to Emacs, many thanks Sulami!
I've released something concerning 1 and 2 (though I'm not convinced 1 is entirely free of edge cases).
3 is somewhat difficult, this package is architecturally not keeping track of values very well, a lot of the data is only persisted as buffer content, which is bad for many reasons, but handling that data is also a bit of a pain in Emacs Lisp (like so many things).
- Thanks.
OK. That's encouraging. Both 1 and 2 are welcome additions. I think clearing the results allows 3, in effect. Just have to re-insert when done.
I'd love an "eval subtree" so it doesn't have to go through my huge buffer. (Ideally taking in the org heading under the cursor or if not on a heading the next heading above it. I don't want to move to the header to refresh my calculation)
cougarten [email protected] writes:
I'd love an "eval subtree" so it doesn't have to go through my huge buffer.
That's something I've been thinking about as well, given how re-scanning the entire buffer on every keystroke is clearly not infinitely scalable. On the other hand I'd have to actually build a dependency tree, which means recursively searching forward on every edit and selectively updating, or at the very least walking the whole buffer with a dynamically modified search term.
It's a nice idea though, I'd have to prototype a bit, and also do some benchmarks in the first place to evaluate options.
-- Robin
Oh right, on any keystroke would be most dope of course :)
Oh right, on any keystroke would be most dope of course :)
Right now it does actually potentially re-evaluate on every keystroke, at least it checks on every buffer edit whether it is likely inside a calc expression.
The problem here of course is very large buffers with many expressions, that might become laggy at some point.