;;;Here are some macros that exercise SES. Set `pause' to t if you want the
;;;macros to pause after each step.
(let* ((pause nil)
- (x (if pause "\18q" ""))
- (y "\18\ 6ses-test.ses\r\e<"))
+ (x (if pause "\^Xq" ""))
+ (y "\^X\^Fses-test.ses\r\^[<"))
;;Fiddle with the existing spreadsheet
(fset 'ses-exercise-example
- (concat "\18\ 6" data-directory "ses-example.ses\r\e<"
- x "\1510\ e"
- x "\v"
- x "\1f"
- x "\10\10\ 6pses-center\r"
- x "\ 6p\r"
- x "\15\10\t\t"
- x "\r\ 2 A9 B9\r"
- x "\15\ e\ 2\ 2\ 2"
- x "\r\ 1\v2\r"
- x "\ e\ e\ 6"
+ (concat "\^X\^F" data-directory "ses-example.ses\r\^[<"
+ x "\^U10\^N"
+ x "\^K"
+ x "\^_"
+ x "\^P\^P\^Fpses-center\r"
+ x "\^Fp\r"
+ x "\^U\^P\t\t"
+ x "\r\^B A9 B9\r"
+ x "\^U\^N\^B\^B\^B"
+ x "\r\^A\^K2\r"
+ x "\^N\^N\^F"
x "50\r"
- x "\154\1f"
- x "\ 3\e\f"
- x "\1f"
- x "(+ \18o\ e\ e\ 6\0\ 6\ 6"
- x "\15-1\18o\ 3\12 \ 3\13\r\ 2"
- x "\1f"
+ x "\^U4\^_"
+ x "\^C\^[\^L"
+ x "\^_"
+ x "(+ \^Xo\^N\^N\^F\0\^F\^F"
+ x "\^U-1\^Xo\^C\^R \^C\^S\r\^B"
+ x "\^_"
x))
;;Create a new spreadsheet
(fset 'ses-exercise-new
(concat y
- x "\ 3\10\"%.8g\"\r"
+ x "\^C\^P\"%.8g\"\r"
x "2\r"
- x "\ f"
- x "\10"
- x "\152\ f"
+ x "\^O"
+ x "\^P"
+ x "\^U2\^O"
x "\"Header\r"
- x "(sqrt 1\r\ 2"
- x "pses-center\r\ 6"
+ x "(sqrt 1\r\^B"
+ x "pses-center\r\^F"
x "\t"
- x "\10(+ A2 A3\r"
- x "\ 6(* B2 A3\r"
- x "\152\ 3\e\b"
- x "\r\7f\7f\7fB3\r"
- x "\18\13"
+ x "\^P(+ A2 A3\r"
+ x "\^F(* B2 A3\r"
+ x "\^U2\^C\^[\^H"
+ x "\r\^?\^?\^?B3\r"
+ x "\^X\^S"
x))
;;Basic cell display
(fset 'ses-exercise-display
- (concat y "\e:(revert-buffer t t)\r"
- x "\ 5"
- x "\"Very long\r\ 2"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^E"
+ x "\"Very long\r\^B"
x "w3\r"
x "w3\r"
- x "(/ 1 0\r\ 2"
- x "234567\r\ 2"
- x "\155w"
- x "\t1\r\ 2"
- x "\ 2\ 3\ 3"
- x "\ 6234567\r\ 2"
- x "\t\ 4\ 2"
- x "\ 2\ 3\ 3"
- x "345678\r\ 2"
- x "\153w"
- x "\0\e>"
- x "\ 3\ 3"
- x "\18\18"
- x "\ 5"
- x "\18\18\ 1"
- x "\ 5"
- x "\ 6\ 5"
- x "\ 3\ 3"
- x "1\r\ 2"
- x "\ 3\ 3\ 6"
- x "\ 5"
- x "\ 2\ 2\ 2\"1234567-1234567-1234567\r\ 2"
- x "123\r\ 2"
- x "\152\ f"
- x "\ e\"1234567-1234567-1234567\r\ 2"
- x "123\r\ 2"
- x "\ 6\ 6w8\r"
- x "\ 2\ 2\"1234567\r"
- x "\ e\ 2w5\r"
+ x "(/ 1 0\r\^B"
+ x "234567\r\^B"
+ x "\^U5w"
+ x "\t1\r\^B"
+ x "\^B\^C\^C"
+ x "\^F234567\r\^B"
+ x "\t\^D\^B"
+ x "\^B\^C\^C"
+ x "345678\r\^B"
+ x "\^U3w"
+ x "\0\^[>"
+ x "\^C\^C"
+ x "\^X\^X"
+ x "\^E"
+ x "\^X\^X\^A"
+ x "\^E"
+ x "\^F\^E"
+ x "\^C\^C"
+ x "1\r\^B"
+ x "\^C\^C\^F"
+ x "\^E"
+ x "\^B\^B\^B\"1234567-1234567-1234567\r\^B"
+ x "123\r\^B"
+ x "\^U2\^O"
+ x "\^N\"1234567-1234567-1234567\r\^B"
+ x "123\r\^B"
+ x "\^F\^Fw8\r"
+ x "\^B\^B\"1234567\r"
+ x "\^N\^Bw5\r"
x))
;;Cell formulas
(fset 'ses-exercise-formulas
- (concat y "\e:(revert-buffer t t)\r"
+ (concat y "\^[:(revert-buffer t t)\r"
x "\t\t"
x "\t"
- x "(* B1 B2 D1\r\ 2"
- x "(* B2 B3\r\ 2"
- x "\ e(apply '+ (ses-range B1 B3)\r\ 2"
- x "(apply 'ses+ (ses-range B1 B3)\r\ 2"
- x "\ e(apply 'ses+ (ses-range A2 A3)\r\ 2"
- x "\ e(mapconcat'number-to-string(ses-range B2 B4) \"-\"\r\ 2"
- x "\ 2(apply 'concat (reverse (ses-range A3 D3))\r\ 2"
- x "\ 2(* (+ A2 A3) (ses+ B2 B3)\r\ 2"
- x "\ e"
- x "\152\ f"
- x "\155\t"
- x "\10(apply 'ses+ (ses-range E1 E2)\r\ 2"
- x "\10(apply 'ses+ (ses-range A5 B5)\r\ 2"
- x "\10(apply 'ses+ (ses-range E1 F1)\r\ 2"
- x "\10(apply 'ses+ (ses-range D1 E1)\r\ 2"
+ x "(* B1 B2 D1\r\^B"
+ x "(* B2 B3\r\^B"
+ x "\^N(apply '+ (ses-range B1 B3)\r\^B"
+ x "(apply 'ses+ (ses-range B1 B3)\r\^B"
+ x "\^N(apply 'ses+ (ses-range A2 A3)\r\^B"
+ x "\^N(mapconcat'number-to-string(ses-range B2 B4) \"-\"\r\^B"
+ x "\^B(apply 'concat (reverse (ses-range A3 D3))\r\^B"
+ x "\^B(* (+ A2 A3) (ses+ B2 B3)\r\^B"
+ x "\^N"
+ x "\^U2\^O"
+ x "\^U5\t"
+ x "\^P(apply 'ses+ (ses-range E1 E2)\r\^B"
+ x "\^P(apply 'ses+ (ses-range A5 B5)\r\^B"
+ x "\^P(apply 'ses+ (ses-range E1 F1)\r\^B"
+ x "\^P(apply 'ses+ (ses-range D1 E1)\r\^B"
x "\t"
- x "(ses-average (ses-range A2 A5)\r\ 2"
- x "\ e(apply 'ses+ (ses-range A5 A6)\r\ 2"
- x "\ 2\ 2\ek"
- x "\ e\ e\v"
- x "\10\10\10\ f"
- x "\ e\152\ f"
- x "\10\153\v"
- x "\ 2\ 2\ 2\eo"
- x "\ 6\152\eo"
- x "\ 2\153\ek"
- x "\ 6(ses-average (ses-range B3 E3)\r\ 2"
- x "\ 2\ek"
- x "\ e\1012345678\r\ 2"
+ x "(ses-average (ses-range A2 A5)\r\^B"
+ x "\^N(apply 'ses+ (ses-range A5 A6)\r\^B"
+ x "\^B\^B\^[k"
+ x "\^N\^N\^K"
+ x "\^P\^P\^P\^O"
+ x "\^N\^U2\^O"
+ x "\^P\^U3\^K"
+ x "\^B\^B\^B\^[o"
+ x "\^F\^U2\^[o"
+ x "\^B\^U3\^[k"
+ x "\^F(ses-average (ses-range B3 E3)\r\^B"
+ x "\^B\^[k"
+ x "\^N\^P12345678\r\^B"
x))
;;Recalculating and reconstructing
(fset 'ses-exercise-recalc
- (concat y "\e:(revert-buffer t t)\r"
- x "\ 3\e\f"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^C\^[\^L"
x "\t\t"
- x "\ 3\ 3"
- x "(/ 1 0\r\ 2"
- x "\ 3\ 3"
+ x "\^C\^C"
+ x "(/ 1 0\r\^B"
+ x "\^C\^C"
x "\n"
- x "\ 3\ 3"
- x "\ 3\10\"%.6g\"\r"
- x "\ 3\e\f"
- x "\e>\18nw\ 6\ 6\ 6"
- x "\0\e>\exdelete-region\r"
- x "\ 3\e\f"
- x "\158\ e"
- x "\0\e>\exdelete-region\r"
- x "\ 3\e\f"
- x "\ 3\ e"
- x "\ e\v\ 2\ek"
- x "\ 3\f"
- x "\ 2\"Very long\r"
- x "\10\ 3\14"
- x "\ 2\r\r"
- x "\ e\ 3\14"
- x "\ 6\eo"
- x "\ 6\ 3\14"
- x "\ 2\ 2\"Very long2\r"
- x "\ 2\eo\ 6"
- x "\ 3\14"
- x "\r\7f\7f\7fC3\r"
- x "\ e\r\7f\7f\7fC2\r"
- x "\10\0\ e\ 6\ 3\ 3"
- x "\r\7f\7fC4\r"
- x "\ e\ e\r\7f\7f\7fC2\r"
- x "\ 6\0\ 2\10\10"
- x "\ 3\ 3"
- x "\exses-mode\r"
- x "\e<\ f"
- x "\152\ek"
+ x "\^C\^C"
+ x "\^C\^P\"%.6g\"\r"
+ x "\^C\^[\^L"
+ x "\^[>\^Xnw\^F\^F\^F"
+ x "\0\^[>\^[xdelete-region\r"
+ x "\^C\^[\^L"
+ x "\^U8\^N"
+ x "\0\^[>\^[xdelete-region\r"
+ x "\^C\^[\^L"
+ x "\^C\^N"
+ x "\^N\^K\^B\^[k"
+ x "\^C\^L"
+ x "\^B\"Very long\r"
+ x "\^P\^C\^T"
+ x "\^B\r\r"
+ x "\^N\^C\^T"
+ x "\^F\^[o"
+ x "\^F\^C\^T"
+ x "\^B\^B\"Very long2\r"
+ x "\^B\^[o\^F"
+ x "\^C\^T"
+ x "\r\^?\^?\^?C3\r"
+ x "\^N\r\^?\^?\^?C2\r"
+ x "\^P\0\^N\^F\^C\^C"
+ x "\r\^?\^?C4\r"
+ x "\^N\^N\r\^?\^?\^?C2\r"
+ x "\^F\0\^B\^P\^P"
+ x "\^C\^C"
+ x "\^[xses-mode\r"
+ x "\^[<\^O"
+ x "\^U2\^[k"
x))
;;Header line
(fset 'ses-exercise-header-row
- (concat y "\e:(revert-buffer t t)\r"
- x "\18<"
- x "\18>"
- x "\156\18<"
- x "\18>"
- x "\157\18<"
- x "\18>"
- x "\158\18<"
- x "\152\18<"
- x "\18>"
- x "\ 6\153w\ 2"
- x "\1510\18<"
- x "\18>"
- x "\152\v"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^X<"
+ x "\^X>"
+ x "\^U6\^X<"
+ x "\^X>"
+ x "\^U7\^X<"
+ x "\^X>"
+ x "\^U8\^X<"
+ x "\^U2\^X<"
+ x "\^X>"
+ x "\^F\^U3w\^B"
+ x "\^U10\^X<"
+ x "\^X>"
+ x "\^U2\^K"
x))
;;Detecting unsafe formulas and printers
(fset 'ses-exercise-unsafe
- (concat y "\e:(revert-buffer t t)\r"
+ (concat y "\^[:(revert-buffer t t)\r"
x "p(lambda (x) (delete-file x))\rn"
x "p(lambda (x) (delete-file \"ses-nothing\"))\ry"
- x "\0\ 6\17\19n"
- x "\ e(delete-file \"x\"\rn"
- x "(delete-file \"ses-nothing\"\ry\ 2"
- x "\0\ 6\17\19n"
- x "(open-network-stream \"x\" nil \"localhost\" \"smtp\"\ry\ 2"
- x "\0\ 6\17\19n"
+ x "\0\^F\^W\^Yn"
+ x "\^N(delete-file \"x\"\rn"
+ x "(delete-file \"ses-nothing\"\ry\^B"
+ x "\0\^F\^W\^Yn"
+ x "(open-network-stream \"x\" nil \"localhost\" \"smtp\"\ry\^B"
+ x "\0\^F\^W\^Yn"
x))
;;Inserting and deleting rows
(fset 'ses-exercise-rows
- (concat y "\e:(revert-buffer t t)\r"
- x "\ e\ 6"
- x "\ 3\10\"%s=\"\r"
- x "\1520\ f"
- x "\ep\"%s+\"\r"
- x "\ e\ f"
- x "123456789\r\ 2"
- x "\0\1521\ e\ 6"
- x "\ 3\ 3"
- x "\e\f"
- x "\10\10(not B25\r\ 2"
- x "\ e\ek"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^N\^F"
+ x "\^C\^P\"%s=\"\r"
+ x "\^U20\^O"
+ x "\^[p\"%s+\"\r"
+ x "\^N\^O"
+ x "123456789\r\^B"
+ x "\0\^U21\^N\^F"
+ x "\^C\^C"
+ x "\^[\^L"
+ x "\^P\^P(not B25\r\^B"
+ x "\^N\^[k"
x "jA3\r"
- x "\1519\v"
- x "\10\ 6\v"
- x "\15100\ f" ;Make this approx your CPU speed in MHz
+ x "\^U19\^K"
+ x "\^P\^F\^K"
+ x "\^U100\^O" ;Make this approx your CPU speed in MHz
x))
;;Inserting and deleting columns
(fset 'ses-exercise-columns
- (concat y "\e:(revert-buffer t t)\r"
- x "\ 3\10\"%s@\"\r"
- x "\eo"
- x "\ f"
- x "\eo"
- x "\v"
- x "\ek"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^C\^P\"%s@\"\r"
+ x "\^[o"
+ x "\^O"
+ x "\^[o"
+ x "\^K"
+ x "\^[k"
x "w8\r"
- x "\ep\"%.7s*\"\r"
- x "\eo"
- x "\ 6"
- x "\152\eo"
- x "\153\ek"
- x "\ 3\10\"%.6g\"\r"
- x "\1526\eo"
- x "\0\1526\t"
- x "\1526\eo"
- x "\ 3\e\b0\r"
- x "\1526\t"
- x "\15400\ 2"
- x "\1550\ek"
- x "\0\ e\ e\ 6\ 6\ 3\e\13D"
+ x "\^[p\"%.7s*\"\r"
+ x "\^[o"
+ x "\^F"
+ x "\^U2\^[o"
+ x "\^U3\^[k"
+ x "\^C\^P\"%.6g\"\r"
+ x "\^U26\^[o"
+ x "\0\^U26\t"
+ x "\^U26\^[o"
+ x "\^C\^[\^H0\r"
+ x "\^U26\t"
+ x "\^U400\^B"
+ x "\^U50\^[k"
+ x "\0\^N\^N\^F\^F\^C\^[\^SD"
x))
(fset 'ses-exercise-editing
- (concat y "\e:(revert-buffer t t)\r"
- x "\ e\ e\ e1\r\ 2"
- x "\ 6(\ 2'\ 6x\r\ 2"
- x "\ 2\10\10\10\ f"
- x "\1f"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^N\^N\^N1\r\^B"
+ x "\^F(\^B'\^Fx\r\^B"
+ x "\^B\^P\^P\^P\^O"
+ x "\^_"
x "\r\r"
x "w9\r"
- x "\ e\r\ 2.5\r"
- x "\ e\ 6\r\ 2 10\r"
+ x "\^N\r\^B.5\r"
+ x "\^N\^F\r\^B 10\r"
x "w12\r"
- x "\r\ 1'\r"
- x "\r\ 1\ 4\r"
+ x "\r\^A'\r"
+ x "\r\^A\^D\r"
x "jA4\r"
- x "(+ A2 100\r\ 2"
- x "\10\103\r\ 2"
+ x "(+ A2 100\r\^B"
+ x "\^P\^P3\r\^B"
x "jB1\r"
- x "(not A1\r\ 2"
- x "\ 2\"Very long\r\ 2"
- x "\ 3\ 3"
- x "\eh"
- x "\eH"
- x "\ 3\ 3"
- x "\e>\t"
- x "\10\10\ 4"
- x "\10\ 4"
- x "\ 6\ 6\152\7f"
- x "\10\7f"
- x "\eo"
- x "\eh"
- x "\0\ f\ 6"
- x "\"Also very long\r\ 2"
- x "\ e\ 6\eH"
- x "\0'\r\ 2"
- x "'Trial\r\ 2"
- x "\ e\ 2'qwerty\r\ 2"
- x "\ 6(concat \18o\e<\0\ e\ e"
- x "\15-1\18o\ 3\12\r\ 2"
- x "(apply '+ \18o\e<\0\ e\ 6\15-1\18o\ 3\13\r\ 2"
- x "\10\152\7f"
- x "\15-2\7f"
- x "\15-2\ 4"
- x "\152\ 4"
- x "\ 2\10\10\v"
- x "\ e\ 6\eH"
- x "\ 2\10\0\ f"
- x "\"Another long one\r\ 2"
- x "\ e\ e\ 6\eH"
- x "\ 1\10\ 5"
- x "\ 3\ 3\e<"
- x "\ e\ 5"
- x "\e>\10\ f"
- x "\0\ 5\ 6\ 5"
+ x "(not A1\r\^B"
+ x "\^B\"Very long\r\^B"
+ x "\^C\^C"
+ x "\^[h"
+ x "\^[H"
+ x "\^C\^C"
+ x "\^[>\t"
+ x "\^P\^P\^D"
+ x "\^P\^D"
+ x "\^F\^F\^U2\^?"
+ x "\^P\^?"
+ x "\^[o"
+ x "\^[h"
+ x "\0\^O\^F"
+ x "\"Also very long\r\^B"
+ x "\^N\^F\^[H"
+ x "\0'\r\^B"
+ x "'Trial\r\^B"
+ x "\^N\^B'qwerty\r\^B"
+ x "\^F(concat \^Xo\^[<\0\^N\^N"
+ x "\^U-1\^Xo\^C\^R\r\^B"
+ x "(apply '+ \^Xo\^[<\0\^N\^F\^U-1\^Xo\^C\^S\r\^B"
+ x "\^P\^U2\^?"
+ x "\^U-2\^?"
+ x "\^U-2\^D"
+ x "\^U2\^D"
+ x "\^B\^P\^P\^K"
+ x "\^N\^F\^[H"
+ x "\^B\^P\0\^O"
+ x "\"Another long one\r\^B"
+ x "\^N\^N\^F\^[H"
+ x "\^A\^P\^E"
+ x "\^C\^C\^[<"
+ x "\^N\^E"
+ x "\^[>\^P\^O"
+ x "\0\^E\^F\^E"
x))
;;Sorting of columns
(fset 'ses-exercise-sort-column
- (concat y "\e:(revert-buffer t t)\r"
+ (concat y "\^[:(revert-buffer t t)\r"
x "\"Very long\r"
- x "\ 699\r"
- x "\ 6\eo13\r"
+ x "\^F99\r"
+ x "\^F\^[o13\r"
x "(+ A3 B3\r"
x "7\r8\r(* A4 B4\r"
- x "\0\10\10\10\ 3\e\13A\r"
- x "\ e\0\10\10\10\ 3\e\13B\r"
- x "\10\10\ 6\0\ e\ e\ 6\ 6\ 3\e\13C\r"
- x "\ 6\eo\10\ f"
- x "\ 2\0\ e\ e\ e\15\ 3\e\13C\r"
+ x "\0\^P\^P\^P\^C\^[\^SA\r"
+ x "\^N\0\^P\^P\^P\^C\^[\^SB\r"
+ x "\^P\^P\^F\0\^N\^N\^F\^F\^C\^[\^SC\r"
+ x "\^F\^[o\^P\^O"
+ x "\^B\0\^N\^N\^N\^U\^C\^[\^SC\r"
x))
;;Simple cell printers
(fset 'ses-exercise-cell-printers
- (concat y "\e:(revert-buffer t t)\r"
- x "\ 6\"4\11\t76\r\ 2"
- x "\"4\11\n7\r\ 2"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^F\"4\^Q\t76\r\^B"
+ x "\"4\^Q\n7\r\^B"
x "p\"{%S}\"\r"
x "p(\"[%s]\")\r"
x "p(\"<%s>\")\r"
- x "\ 2\0\ 6\ 6"
+ x "\^B\0\^F\^F"
x "p\r"
x "pnil\r"
x "pses-dashfill\r"
- x "48\r\ 2"
+ x "48\r\^B"
x "\t"
- x "\ 2\0\ 6p\r"
- x "\ 6p\r"
+ x "\^B\0\^Fp\r"
+ x "\^Fp\r"
x "pses-dashfill\r"
- x "\ 2\0\ 6\ 6pnil\r"
- x "5\r\ 2"
+ x "\^B\0\^F\^Fpnil\r"
+ x "5\r\^B"
x "pses-center\r"
- x "\ 3\10\"%s\"\r"
+ x "\^C\^P\"%s\"\r"
x "w8\r"
- x "\ep\r"
- x "\ep\"%.7g@\"\r"
- x "\ 3\10\r"
- x "\ 3\10\"%.6g#\"\r"
- x "\ 3\10\"%.6g.\"\r"
- x "\ 3\10\"%.6g.\"\r"
- x "\epidentity\r"
- x "6\r\ 2"
- x "\ e\"UPCASE\r\ 2"
- x "\epdowncase\r"
- x "(* 3 4\r\ 2"
- x "p(lambda\11 (x)\11 '(\"Hi\"))\r"
- x "p(lambda\11 (x)\11 '(\"Bye\"))\r"
+ x "\^[p\r"
+ x "\^[p\"%.7g@\"\r"
+ x "\^C\^P\r"
+ x "\^C\^P\"%.6g#\"\r"
+ x "\^C\^P\"%.6g.\"\r"
+ x "\^C\^P\"%.6g.\"\r"
+ x "\^[pidentity\r"
+ x "6\r\^B"
+ x "\^N\"UPCASE\r\^B"
+ x "\^[pdowncase\r"
+ x "(* 3 4\r\^B"
+ x "p(lambda\^Q (x)\^Q '(\"Hi\"))\r"
+ x "p(lambda\^Q (x)\^Q '(\"Bye\"))\r"
x))
;;Spanning cell printers
(fset 'ses-exercise-spanning-printers
- (concat y "\e:(revert-buffer t t)\r"
- x "\ep\"%.6g*\"\r"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^[p\"%.6g*\"\r"
x "pses-dashfill-span\r"
- x "5\r\ 2"
+ x "5\r\^B"
x "pses-tildefill-span\r"
- x "\"4\r\ 2"
- x "\ep\"$%s\"\r"
- x "\ep(\"$%s\")\r"
- x "8\r\ 2"
- x "\ep(\"!%s!\")\r"
- x "\t\"12345678\r\ 2"
+ x "\"4\r\^B"
+ x "\^[p\"$%s\"\r"
+ x "\^[p(\"$%s\")\r"
+ x "8\r\^B"
+ x "\^[p(\"!%s!\")\r"
+ x "\t\"12345678\r\^B"
x "pses-dashfill-span\r"
- x "\"23456789\r\ 2"
+ x "\"23456789\r\^B"
x "\t"
- x "(not t\r\ 2"
- x "\ 2w6\r"
- x "\"5\r\ 2"
- x "\ e\ 6\eo"
- x "\ek"
- x "\ek"
+ x "(not t\r\^B"
+ x "\^Bw6\r"
+ x "\"5\r\^B"
+ x "\^N\^F\^[o"
+ x "\^[k"
+ x "\^[k"
x "\t"
- x "\ 2\10\ 3\ 3"
- x "\eo"
- x "\ e\152\ek"
- x "\ 2\ 2\ek"
+ x "\^B\^P\^C\^C"
+ x "\^[o"
+ x "\^N\^U2\^[k"
+ x "\^B\^B\^[k"
x))
;;Cut/copy/paste - within same buffer
(fset 'ses-exercise-paste-1buf
- (concat y "\e:(revert-buffer t t)\r"
- x "\ e\0\ 6\ew"
- x "\ 3\ 3\10\ 6\19"
- x "\ e\eo"
- x "\"middle\r\ 2"
- x "\0\ 6\ e\ 6"
- x "\ew"
- x "\10\0\ 6"
- x "\ew"
- x "\ 3\ 3\ 6\ e"
- x "\19"
- x "\152\19y"
- x "\ 6\15\19y"
- x "\10\10\ 6\15\19y"
- x "\e>"
- x "\19y"
- x "\e>\19y"
- x "\e<"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^N\0\^F\^[w"
+ x "\^C\^C\^P\^F\^Y"
+ x "\^N\^[o"
+ x "\"middle\r\^B"
+ x "\0\^F\^N\^F"
+ x "\^[w"
+ x "\^P\0\^F"
+ x "\^[w"
+ x "\^C\^C\^F\^N"
+ x "\^Y"
+ x "\^U2\^Yy"
+ x "\^F\^U\^Yy"
+ x "\^P\^P\^F\^U\^Yy"
+ x "\^[>"
+ x "\^Yy"
+ x "\^[>\^Yy"
+ x "\^[<"
x "p\"<%s>\"\r"
- x "\ 6pses-dashfill\r"
- x "\ 2\0\ 6\ 6\ 6\ e\ e\ e"
- x "\17"
- x "\1f"
- x "\15\19y"
- x "\r\0\ 2\ 2\ 2\ew"
- x "\r\ 6\19"
- x "\153\10(+ G2 H1\r"
- x "\0\ 2\ew"
- x "\ 3\ 3\e>\ 2"
- x "\19"
- x "\ 2\158\10(ses-average (ses-range G2 H2)\r\ 2"
- x "\0\ 6\17\ek"
- x "\157\ e"
- x "\19"
- x "\10\ 2(ses-average (ses-range E7 E9)\r\ 2"
- x "\0\ 6\17\v"
- x "\ e\19"
- x "\ 2\ 2\10(ses-average (ses-range E7 F7)\r\ 2"
- x "\0\ 6\17\ek"
- x "\ 6\19"
- x "\ 2\ 2\10(ses-average (ses-range D6 E6)\r\ 2"
- x "\0\ 6\17\ek"
- x "\ 6\19"
- x "\ 1\152\ f"
- x "\"Line A\r\ 2"
+ x "\^Fpses-dashfill\r"
+ x "\^B\0\^F\^F\^F\^N\^N\^N"
+ x "\^W"
+ x "\^_"
+ x "\^U\^Yy"
+ x "\r\0\^B\^B\^B\^[w"
+ x "\r\^F\^Y"
+ x "\^U3\^P(+ G2 H1\r"
+ x "\0\^B\^[w"
+ x "\^C\^C\^[>\^B"
+ x "\^Y"
+ x "\^B\^U8\^P(ses-average (ses-range G2 H2)\r\^B"
+ x "\0\^F\^W\^[k"
+ x "\^U7\^N"
+ x "\^Y"
+ x "\^P\^B(ses-average (ses-range E7 E9)\r\^B"
+ x "\0\^F\^W\^K"
+ x "\^N\^Y"
+ x "\^B\^B\^P(ses-average (ses-range E7 F7)\r\^B"
+ x "\0\^F\^W\^[k"
+ x "\^F\^Y"
+ x "\^B\^B\^P(ses-average (ses-range D6 E6)\r\^B"
+ x "\0\^F\^W\^[k"
+ x "\^F\^Y"
+ x "\^A\^U2\^O"
+ x "\"Line A\r\^B"
x "pses-tildefill-span\r"
- x "\ e\ 6\"Subline A(1)\r\ 2"
+ x "\^N\^F\"Subline A(1)\r\^B"
x "pses-dashfill-span\r"
- x "\ 2\10\0\ e\ e\ e\ew\ 3\ 3"
- x "\ 1\10\10\10\10\10\10"
- x "\19"
- x "\0\ e\ 6\ 6\ew\ 3\ 3"
- x "\ 6\19"
+ x "\^B\^P\0\^N\^N\^N\^[w\^C\^C"
+ x "\^A\^P\^P\^P\^P\^P\^P"
+ x "\^Y"
+ x "\0\^N\^F\^F\^[w\^C\^C"
+ x "\^F\^Y"
x))
;;Cut/copy/paste - between two buffers
(fset 'ses-exercise-paste-2buf
- (concat y "\e:(revert-buffer t t)\r"
- x "\ 6\ e\eo\"middle\r\ 2\0\ 6\ e\ 6"
- x "\17"
- x "\184bses-test.txt\r"
- x " \ 1\19"
- x "\ 5\"xxx\0\ 2\ 2\ 2\ 2"
- x "\ew\18o"
- x "\1f"
- x "\19"
- x "\18o\ 5\"\0\ 2\ 2\ 2\ 2\ 2"
- x "\ew\18o\19"
- x "\18o123.45\0\ 2\ 2\ 2\ 2\ 2\ 2"
- x "\17\18o\19"
- x "\18o1 \ 2\ 2\0\ 6\ 6\ 6\ 6\ 6\ 6\ 6"
- x "\17\18o\19"
- x "\e>\19y"
- x "\ 6\18o symb\0\ 2\ 2\ 2\ 2"
- x "\17\18o\15\19\ey\152\ey"
- x "\18o1\t\0\ 2\ 2"
- x "\17\18o\ 2\19"
- x "w9\n\ep\"<%s>\"\n"
- x "\18o\n2\t\"3\nxxx\t5\n\0\10\10"
- x "\17\18o\19y"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^F\^N\^[o\"middle\r\^B\0\^F\^N\^F"
+ x "\^W"
+ x "\^X4bses-test.txt\r"
+ x " \^A\^Y"
+ x "\^E\"xxx\0\^B\^B\^B\^B"
+ x "\^[w\^Xo"
+ x "\^_"
+ x "\^Y"
+ x "\^Xo\^E\"\0\^B\^B\^B\^B\^B"
+ x "\^[w\^Xo\^Y"
+ x "\^Xo123.45\0\^B\^B\^B\^B\^B\^B"
+ x "\^W\^Xo\^Y"
+ x "\^Xo1 \^B\^B\0\^F\^F\^F\^F\^F\^F\^F"
+ x "\^W\^Xo\^Y"
+ x "\^[>\^Yy"
+ x "\^F\^Xo symb\0\^B\^B\^B\^B"
+ x "\^W\^Xo\^U\^Y\^[y\^U2\^[y"
+ x "\^Xo1\t\0\^B\^B"
+ x "\^W\^Xo\^B\^Y"
+ x "w9\n\^[p\"<%s>\"\n"
+ x "\^Xo\n2\t\"3\nxxx\t5\n\0\^P\^P"
+ x "\^W\^Xo\^Yy"
x))
;;Export text, import it back
(fset 'ses-exercise-import-export
- (concat y "\e:(revert-buffer t t)\r"
- x "\ e\ e\ 6\0\ 6xt"
- x "\184bses-test.txt\r"
- x "\n\19\15-1\18o"
- x "xT\18o\19\15-1\18o"
- x "\ 3\ 3\ 6'crunch\r\ 2"
- x "\10\10\10pses-center-span\r"
- x "\0\ e\ e\ e\ exT"
- x "\18o\n\19\15-1\18o"
- x "\0\19y"
- x "\ 6\0\ 2\10\10xt"
- x "\ e\ e\0\15\19y"
- x "12345678\r\ 2"
- x "\ 6\ 6'bunch\r"
- x "\0\10\10xtxT"
+ (concat y "\^[:(revert-buffer t t)\r"
+ x "\^N\^N\^F\0\^Fxt"
+ x "\^X4bses-test.txt\r"
+ x "\n\^Y\^U-1\^Xo"
+ x "xT\^Xo\^Y\^U-1\^Xo"
+ x "\^C\^C\^F'crunch\r\^B"
+ x "\^P\^P\^Ppses-center-span\r"
+ x "\0\^N\^N\^N\^NxT"
+ x "\^Xo\n\^Y\^U-1\^Xo"
+ x "\0\^Yy"
+ x "\^F\0\^B\^P\^Pxt"
+ x "\^N\^N\0\^U\^Yy"
+ x "12345678\r\^B"
+ x "\^F\^F'bunch\r"
+ x "\0\^P\^PxtxT"
x)))
(defun ses-exercise-macros ()
(let ((curcell '(A1 . A2))) (ses-check-curcell 'end))
(let ((curcell '(A1 . A2))) (ses-sort-column "B"))
(let ((curcell '(C1 . D2))) (ses-sort-column "B"))
- (execute-kbd-macro "jB10\n\152\ 4")
+ (execute-kbd-macro "jB10\n\^U2\^D")
(execute-kbd-macro [?j ?B ?9 ?\n ?\C-@ ?\C-f ?\C-f cut])
- (progn (kill-new "x") (execute-kbd-macro "\e>\19n"))
- (execute-kbd-macro "\ 2\0\ew")))
+ (progn (kill-new "x") (execute-kbd-macro "\^[>\^Yn"))
+ (execute-kbd-macro "\^B\0\^[w")))
(condition-case nil
(progn
(eval x)
(defun ses-exercise-invalid-spreadsheets ()
"Execute code paths that detect invalid spreadsheet files."
;;Detect invalid spreadsheets
- (let ((p&d "\n\n\f\n(ses-cell A1 nil nil nil nil)\n\n")
+ (let ((p&d "\n\n\^L\n(ses-cell A1 nil nil nil nil)\n\n")
(cw "(ses-column-widths [7])\n")
(cp "(ses-column-printers [ses-center])\n")
(dp "(ses-default-printer \"%.7g\")\n")
"(1 2 x)"
"(1 2 -1)"
"(3 1 1)"
- "\n\n\f(2 1 1)"
- "\n\n\f\n(ses-cell)(2 1 1)"
- "\n\n\f\n(x)\n(2 1 1)"
- "\n\n\n\f\n(ses-cell A2)\n(2 2 2)"
- "\n\n\n\f\n(ses-cell B1)\n(2 2 2)"
- "\n\n\f\n(ses-cell A1 nil nil nil nil)\n(2 1 1)"
+ "\n\n\^L(2 1 1)"
+ "\n\n\^L\n(ses-cell)(2 1 1)"
+ "\n\n\^L\n(x)\n(2 1 1)"
+ "\n\n\n\^L\n(ses-cell A2)\n(2 2 2)"
+ "\n\n\n\^L\n(ses-cell B1)\n(2 2 2)"
+ "\n\n\^L\n(ses-cell A1 nil nil nil nil)\n(2 1 1)"
(concat p&d "(x)\n(x)\n(x)\n(x)\n" p11)
(concat p&d "(ses-column-widths)(x)\n(x)\n(x)\n" p11)
(concat p&d cw "(x)\n(x)\n(x)\n(2 1 1)")
(ses-exercise-invalid-spreadsheets)
;;Upgrade of old-style spreadsheet
(with-temp-buffer
- (insert " \n\n\f\n(ses-cell A1 nil nil nil nil)\n\n(ses-column-widths [7])\n(ses-column-printers [nil])\n(ses-default-printer \"%.7g\")\n\n( ;Global parameters (these are read first)\n 1 ;SES file-format\n 1 ;numrows\n 1 ;numcols\n)\n\n")
+ (insert " \n\n\^L\n(ses-cell A1 nil nil nil nil)\n\n(ses-column-widths [7])\n(ses-column-printers [nil])\n(ses-default-printer \"%.7g\")\n\n( ;Global parameters (these are read first)\n 1 ;SES file-format\n 1 ;numrows\n 1 ;numcols\n)\n\n")
(ses-load))
;;ses-vector-delete is always called from buffer-undo-list with the same
;;symbol as argument. We'll give it a different one here.