Quick
index
main
eev
eepitch
maths
angg
blogme
dednat6
littlelangs
PURO
(GAC2,
C3TD,
λMDetc)
(Chapa 1)

emacs
lua
(la)tex
maxima
fvwm
agda
tcl
forth
icon
debian
irc
contact

Eev and Calc

In 2022-apr-01 I sent this e-mail to help-gnu-emacs showing how I was trying to use SVG with eev; my goal was to connect that to emlua. Then Michael Heerdegen asked me why I didn't use calc; I answered something like "help please", and he sent me this example.

My main difficulty with Calc was this:

I was never able to learn Calc properly, and I _guess_ that the main reason for that is because I've never found a good way to record my interactions with Calc and "play them back" later.

but I found a way to "script" his example. My code was:

(defun eek-at-window (window keyseq)
  (save-selected-window
    (select-window (get-buffer-window window))
    (eek keyseq)))

(defun eec (keyseq) (eek-at-window "*Calculator*" keyseq))

(defun ee-show-calc-windows ()
  (interactive)
  (find-wset "13o_3o_o"
    '(find-ebuffer "*Calculator*")
    '(find-ebuffer "*Calc Trail*")))

* (calc) (eek "C-x 3 M-1 M-j")
* (ee-show-calc-windows)
* (eec "' [x0-1 .. x0+1] RET             ;; interval")
* (eec "' [y0-1 .. y0+1] RET             ;; ditto")
* (eec "' (x-x0)^2 - (y-y0)^2 + 2 RET    ;; alt: define a named function")
* (eec "3 s t x0 RET                     ;; set x0 to 3")
* (eec "2 s t y0 RET                     ;; set y0 to 2")
* (eec "M-3 =          ;; updates topmost 3 stack values with vars substituted")
* (eec "g F            ;; draw it")

Click on the thumbnail below to enlarge it, and click here to watch a 27s movie of the script above being "played back". Note that the last command in it - the one with the comment "draw it" - calls Gnuplot to draw something similar, but uglier, to the third thumbnail here.