Commit 20b858ef authored by Paul Eggert's avatar Paul Eggert

Prefer \... to control chars in .el literals

parent 00c1f771
...@@ -1095,7 +1095,7 @@ Marks the function with their arguments, and returns a list of variables." ...@@ -1095,7 +1095,7 @@ Marks the function with their arguments, and returns a list of variables."
(set-buffer (get-buffer-create docbuf)) (set-buffer (get-buffer-create docbuf))
(insert-file-contents-literally (insert-file-contents-literally
(expand-file-name internal-doc-file-name doc-directory))) (expand-file-name internal-doc-file-name doc-directory)))
(while (re-search-forward "\\([VF]\\)" nil t) (while (re-search-forward "\^_\\([VF]\\)" nil t)
(when (setq sym (intern-soft (buffer-substring (point) (when (setq sym (intern-soft (buffer-substring (point)
(line-end-position)))) (line-end-position))))
(if (string-equal (match-string 1) "V") (if (string-equal (match-string 1) "V")
...@@ -1104,7 +1104,7 @@ Marks the function with their arguments, and returns a list of variables." ...@@ -1104,7 +1104,7 @@ Marks the function with their arguments, and returns a list of variables."
(if (boundp sym) (setq vars (cons sym vars))) (if (boundp sym) (setq vars (cons sym vars)))
;; Function. ;; Function.
(when (fboundp sym) (when (fboundp sym)
(when (re-search-forward "\\(^(fn.*)\\)?" nil t) (when (re-search-forward "\\(^(fn.*)\\)?\^_" nil t)
(backward-char 1) (backward-char 1)
;; FIXME distinguish no args from not found. ;; FIXME distinguish no args from not found.
(and (setq args (match-string 1)) (and (setq args (match-string 1))
......
...@@ -41,13 +41,13 @@ ...@@ -41,13 +41,13 @@
'((:around "\300\301\302\003#\207" 5) '((:around "\300\301\302\003#\207" 5)
(:before "\300\301\002\"\210\300\302\002\"\207" 4) (:before "\300\301\002\"\210\300\302\002\"\207" 4)
(:after "\300\302\002\"\300\301\003\"\210\207" 5) (:after "\300\302\002\"\300\301\003\"\210\207" 5)
(:override "\300\301\"\207" 4) (:override "\300\301\002\"\207" 4)
(:after-until "\300\302\002\"\206\013\000\300\301\002\"\207" 4) (:after-until "\300\302\002\"\206\013\000\300\301\002\"\207" 4)
(:after-while "\300\302\002\"\205\013\000\300\301\002\"\207" 4) (:after-while "\300\302\002\"\205\013\000\300\301\002\"\207" 4)
(:before-until "\300\301\002\"\206\013\000\300\302\002\"\207" 4) (:before-until "\300\301\002\"\206\013\000\300\302\002\"\207" 4)
(:before-while "\300\301\002\"\205\013\000\300\302\002\"\207" 4) (:before-while "\300\301\002\"\205\013\000\300\302\002\"\207" 4)
(:filter-args "\300\302\301!\"\207" 5) (:filter-args "\300\302\301\003!\"\207" 5)
(:filter-return "\301\300\302\"!\207" 5)) (:filter-return "\301\300\302\003\"!\207" 5))
"List of descriptions of how to add a function. "List of descriptions of how to add a function.
Each element has the form (WHERE BYTECODE STACK) where: Each element has the form (WHERE BYTECODE STACK) where:
WHERE is a keyword indicating where the function is added. WHERE is a keyword indicating where the function is added.
......
...@@ -39,464 +39,464 @@ ...@@ -39,464 +39,464 @@
;;;Here are some macros that exercise SES. Set `pause' to t if you want the ;;;Here are some macros that exercise SES. Set `pause' to t if you want the
;;;macros to pause after each step. ;;;macros to pause after each step.
(let* ((pause nil) (let* ((pause nil)
(x (if pause "q" "")) (x (if pause "\^Xq" ""))
(y "ses-test.ses\r<")) (y "\^X\^Fses-test.ses\r\^[<"))
;;Fiddle with the existing spreadsheet ;;Fiddle with the existing spreadsheet
(fset 'ses-exercise-example (fset 'ses-exercise-example
(concat "" data-directory "ses-example.ses\r<" (concat "\^X\^F" data-directory "ses-example.ses\r\^[<"
x "10" x "\^U10\^N"
x " " x "\^K"
x "" x "\^_"
x "pses-center\r" x "\^P\^P\^Fpses-center\r"
x "p\r" x "\^Fp\r"
x "\t\t" x "\^U\^P\t\t"
x "\r A9 B9\r" x "\r\^B A9 B9\r"
x "" x "\^U\^N\^B\^B\^B"
x "\r 2\r" x "\r\^A\^K2\r"
x "" x "\^N\^N\^F"
x "50\r" x "50\r"
x "4" x "\^U4\^_"
x " " x "\^C\^[\^L"
x "" x "\^_"
x "(+ o\0" x "(+ \^Xo\^N\^N\^F\0\^F\^F"
x "-1o \r" x "\^U-1\^Xo\^C\^R \^C\^S\r\^B"
x "" x "\^_"
x)) x))
;;Create a new spreadsheet ;;Create a new spreadsheet
(fset 'ses-exercise-new (fset 'ses-exercise-new
(concat y (concat y
x "\"%.8g\"\r" x "\^C\^P\"%.8g\"\r"
x "2\r" x "2\r"
x "" x "\^O"
x "" x "\^P"
x "2" x "\^U2\^O"
x "\"Header\r" x "\"Header\r"
x "(sqrt 1\r" x "(sqrt 1\r\^B"
x "pses-center\r" x "pses-center\r\^F"
x "\t" x "\t"
x "(+ A2 A3\r" x "\^P(+ A2 A3\r"
x "(* B2 A3\r" x "\^F(* B2 A3\r"
x "2" x "\^U2\^C\^[\^H"
x "\rB3\r" x "\r\^?\^?\^?B3\r"
x "" x "\^X\^S"
x)) x))
;;Basic cell display ;;Basic cell display
(fset 'ses-exercise-display (fset 'ses-exercise-display
(concat y ":(revert-buffer t t)\r" (concat y "\^[:(revert-buffer t t)\r"
x "" x "\^E"
x "\"Very long\r" x "\"Very long\r\^B"
x "w3\r" x "w3\r"
x "w3\r" x "w3\r"
x "(/ 1 0\r" x "(/ 1 0\r\^B"
x "234567\r" x "234567\r\^B"
x "5w" x "\^U5w"
x "\t1\r" x "\t1\r\^B"
x "" x "\^B\^C\^C"
x "234567\r" x "\^F234567\r\^B"
x "\t" x "\t\^D\^B"
x "" x "\^B\^C\^C"
x "345678\r" x "345678\r\^B"
x "3w" x "\^U3w"
x "\0>" x "\0\^[>"
x "" x "\^C\^C"
x "" x "\^X\^X"
x "" x "\^E"
x "" x "\^X\^X\^A"
x "" x "\^E"
x "" x "\^F\^E"
x "" x "\^C\^C"
x "1\r" x "1\r\^B"
x "" x "\^C\^C\^F"
x "" x "\^E"
x "\"1234567-1234567-1234567\r" x "\^B\^B\^B\"1234567-1234567-1234567\r\^B"
x "123\r" x "123\r\^B"
x "2" x "\^U2\^O"
x "\"1234567-1234567-1234567\r" x "\^N\"1234567-1234567-1234567\r\^B"
x "123\r" x "123\r\^B"
x "w8\r" x "\^F\^Fw8\r"
x "\"1234567\r" x "\^B\^B\"1234567\r"
x "w5\r" x "\^N\^Bw5\r"
x)) x))
;;Cell formulas ;;Cell formulas
(fset 'ses-exercise-formulas (fset 'ses-exercise-formulas
(concat y ":(revert-buffer t t)\r" (concat y "\^[:(revert-buffer t t)\r"
x "\t\t" x "\t\t"
x "\t" x "\t"
x "(* B1 B2 D1\r" x "(* B1 B2 D1\r\^B"
x "(* B2 B3\r" x "(* B2 B3\r\^B"
x "(apply '+ (ses-range B1 B3)\r" x "\^N(apply '+ (ses-range B1 B3)\r\^B"
x "(apply 'ses+ (ses-range B1 B3)\r" x "(apply 'ses+ (ses-range B1 B3)\r\^B"
x "(apply 'ses+ (ses-range A2 A3)\r" x "\^N(apply 'ses+ (ses-range A2 A3)\r\^B"
x "(mapconcat'number-to-string(ses-range B2 B4) \"-\"\r" x "\^N(mapconcat'number-to-string(ses-range B2 B4) \"-\"\r\^B"
x "(apply 'concat (reverse (ses-range A3 D3))\r" x "\^B(apply 'concat (reverse (ses-range A3 D3))\r\^B"
x "(* (+ A2 A3) (ses+ B2 B3)\r" x "\^B(* (+ A2 A3) (ses+ B2 B3)\r\^B"
x "" x "\^N"
x "2" x "\^U2\^O"
x "5\t" x "\^U5\t"
x "(apply 'ses+ (ses-range E1 E2)\r" x "\^P(apply 'ses+ (ses-range E1 E2)\r\^B"
x "(apply 'ses+ (ses-range A5 B5)\r" x "\^P(apply 'ses+ (ses-range A5 B5)\r\^B"
x "(apply 'ses+ (ses-range E1 F1)\r" x "\^P(apply 'ses+ (ses-range E1 F1)\r\^B"
x "(apply 'ses+ (ses-range D1 E1)\r" x "\^P(apply 'ses+ (ses-range D1 E1)\r\^B"
x "\t" x "\t"
x "(ses-average (ses-range A2 A5)\r" x "(ses-average (ses-range A2 A5)\r\^B"
x "(apply 'ses+ (ses-range A5 A6)\r" x "\^N(apply 'ses+ (ses-range A5 A6)\r\^B"
x "k" x "\^B\^B\^[k"
x " " x "\^N\^N\^K"
x "" x "\^P\^P\^P\^O"
x "2" x "\^N\^U2\^O"
x "3 " x "\^P\^U3\^K"
x "o" x "\^B\^B\^B\^[o"
x "2o" x "\^F\^U2\^[o"
x "3k" x "\^B\^U3\^[k"
x "(ses-average (ses-range B3 E3)\r" x "\^F(ses-average (ses-range B3 E3)\r\^B"
x "k" x "\^B\^[k"
x "12345678\r" x "\^N\^P12345678\r\^B"
x)) x))
;;Recalculating and reconstructing ;;Recalculating and reconstructing
(fset 'ses-exercise-recalc (fset 'ses-exercise-recalc
(concat y ":(revert-buffer t t)\r" (concat y "\^[:(revert-buffer t t)\r"
x " " x "\^C\^[\^L"
x "\t\t" x "\t\t"
x "" x "\^C\^C"
x "(/ 1 0\r" x "(/ 1 0\r\^B"
x "" x "\^C\^C"
x "\n" x "\n"
x "" x "\^C\^C"
x "\"%.6g\"\r" x "\^C\^P\"%.6g\"\r"
x " " x "\^C\^[\^L"
x ">nw" x "\^[>\^Xnw\^F\^F\^F"
x "\0>xdelete-region\r" x "\0\^[>\^[xdelete-region\r"
x " " x "\^C\^[\^L"
x "8" x "\^U8\^N"
x "\0>xdelete-region\r" x "\0\^[>\^[xdelete-region\r"
x " " x "\^C\^[\^L"
x "" x "\^C\^N"
x " k" x "\^N\^K\^B\^[k"
x " " x "\^C\^L"
x "\"Very long\r" x "\^B\"Very long\r"
x "" x "\^P\^C\^T"
x "\r\r" x "\^B\r\r"
x "" x "\^N\^C\^T"
x "o" x "\^F\^[o"
x "" x "\^F\^C\^T"
x "\"Very long2\r" x "\^B\^B\"Very long2\r"
x "o" x "\^B\^[o\^F"
x "" x "\^C\^T"
x "\rC3\r" x "\r\^?\^?\^?C3\r"
x "\rC2\r" x "\^N\r\^?\^?\^?C2\r"
x "\0" x "\^P\0\^N\^F\^C\^C"
x "\rC4\r" x "\r\^?\^?C4\r"
x "\rC2\r" x "\^N\^N\r\^?\^?\^?C2\r"
x "\0" x "\^F\0\^B\^P\^P"
x "" x "\^C\^C"
x "xses-mode\r" x "\^[xses-mode\r"
x "<" x "\^[<\^O"
x "2k" x "\^U2\^[k"
x)) x))
;;Header line ;;Header line
(fset 'ses-exercise-header-row (fset 'ses-exercise-header-row
(concat y ":(revert-buffer t t)\r" (concat y "\^[:(revert-buffer t t)\r"
x "<" x "\^X<"
x ">" x "\^X>"
x "6<" x "\^U6\^X<"
x ">" x "\^X>"
x "7<" x "\^U7\^X<"
x ">" x "\^X>"
x "8<" x "\^U8\^X<"
x "2<" x "\^U2\^X<"
x ">" x "\^X>"
x "3w" x "\^F\^U3w\^B"
x "10<" x "\^U10\^X<"
x ">" x "\^X>"
x "2 " x "\^U2\^K"
x)) x))
;;Detecting unsafe formulas and printers ;;Detecting unsafe formulas and printers
(fset 'ses-exercise-unsafe (fset 'ses-exercise-unsafe
(concat y ":(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 x))\rn"
x "p(lambda (x) (delete-file \"ses-nothing\"))\ry" x "p(lambda (x) (delete-file \"ses-nothing\"))\ry"
x "\0n" x "\0\^F\^W\^Yn"
x "(delete-file \"x\"\rn" x "\^N(delete-file \"x\"\rn"
x "(delete-file \"ses-nothing\"\ry" x "(delete-file \"ses-nothing\"\ry\^B"
x "\0n" x "\0\^F\^W\^Yn"
x "(open-network-stream \"x\" nil \"localhost\" \"smtp\"\ry" x "(open-network-stream \"x\" nil \"localhost\" \"smtp\"\ry\^B"
x "\0n" x "\0\^F\^W\^Yn"
x)) x))
;;Inserting and deleting rows ;;Inserting and deleting rows
(fset 'ses-exercise-rows (fset 'ses-exercise-rows
(concat y ":(revert-buffer t t)\r" (concat y "\^[:(revert-buffer t t)\r"
x "" x "\^N\^F"
x "\"%s=\"\r" x "\^C\^P\"%s=\"\r"
x "20" x "\^U20\^O"
x "p\"%s+\"\r" x "\^[p\"%s+\"\r"
x "" x "\^N\^O"
x "123456789\r" x "123456789\r\^B"
x "\021" x "\0\^U21\^N\^F"
x "" x "\^C\^C"
x " " x "\^[\^L"
x "(not B25\r" x "\^P\^P(not B25\r\^B"
x "k" x "\^N\^[k"
x "jA3\r" x "jA3\r"
x "19 " x "\^U19\^K"
x " " x "\^P\^F\^K"
x "100" ;Make this approx your CPU speed in MHz x "\^U100\^O" ;Make this approx your CPU speed in MHz
x)) x))
;;Inserting and deleting columns ;;Inserting and deleting columns
(fset 'ses-exercise-columns (fset 'ses-exercise-columns
(concat y ":(revert-buffer t t)\r" (concat y "\^[:(revert-buffer t t)\r"
x "\"%s@\"\r" x "\^C\^P\"%s@\"\r"
x "o" x "\^[o"
x "" x "\^O"
x "o" x "\^[o"
x " " x "\^K"
x "k" x "\^[k"
x "w8\r" x "w8\r"
x "p\"%.7s*\"\r" x "\^[p\"%.7s*\"\r"
x "o" x "\^[o"
x "" x "\^F"
x "2o" x "\^U2\^[o"
x "3k" x "\^U3\^[k"
x "\"%.6g\"\r" x "\^C\^P\"%.6g\"\r"
x "26o" x "\^U26\^[o"
x "\026\t" x "\0\^U26\t"
x "26o" x "\^U26\^[o"
x "0\r" x "\^C\^[\^H0\r"
x "26\t" x "\^U26\t"
x "400" x "\^U400\^B"
x "50k" x "\^U50\^[k"
x "\0D" x "\0\^N\^N\^F\^F\^C\^[\^SD"
x)) x))
(fset 'ses-exercise-editing (fset 'ses-exercise-editing
(concat y ":(revert-buffer t t)\r" (concat y "\^[:(revert-buffer t t)\r"
x "1\r" x "\^N\^N\^N1\r\^B"
x "('x\r" x "\^F(\^B'\^Fx\r\^B"
x "" x "\^B\^P\^P\^P\^O"
x "" x "\^_"
x "\r\r" x "\r\r"
x "w9\r" x "w9\r"
x "\r.5\r" x "\^N\r\^B.5\r"
x "\r 10\r" x "\^N\^F\r\^B 10\r"
x "w12\r" x "w12\r"
x "\r'\r" x "\r\^A'\r"
x "\r\r" x "\r\^A\^D\r"
x "jA4\r" x "jA4\r"
x "(+ A2 100\r" x "(+ A2 100\r\^B"
x "3\r" x "\^P\^P3\r\^B"
x "jB1\r" x "jB1\r"
x "(not A1\r" x "(not A1\r\^B"
x "\"Very long\r" x "\^B\"Very long\r\^B"
x "" x "\^C\^C"
x "h" x "\^[h"
x "H" x "\^[H"
x "" x "\^C\^C"
x ">\t" x "\^[>\t"
x "" x "\^P\^P\^D"
x "" x "\^P\^D"
x "2" x "\^F\^F\^U2\^?"
x "" x "\^P\^?"
x "o" x "\^[o"
x "h" x "\^[h"
x "\0" x "\0\^O\^F"
x "\"Also very long\r" x "\"Also very long\r\^B"
x "H" x "\^N\^F\^[H"
x "\0'\r" x "\0'\r\^B"
x "'Trial\r" x "'Trial\r\^B"
x "'qwerty\r" x "\^N\^B'qwerty\r\^B"
x "(concat o<\0" x "\^F(concat \^Xo\^[<\0\^N\^N"
x "-1o\r" x "\^U-1\^Xo\^C\^R\r\^B"
x "(apply '+ o<\0-1o\r" x "(apply '+ \^Xo\^[<\0\^N\^F\^U-1\^Xo\^C\^S\r\^B"
x "2" x "\^P\^U2\^?"
x "-2" x "\^U-2\^?"
x "-2" x "\^U-2\^D"
x "2" x "\^U2\^D"
x " " x "\^B\^P\^P\^K"
x "H" x "\^N\^F\^[H"
x "\0" x "\^B\^P\0\^O"
x "\"Another long one\r" x "\"Another long one\r\^B"
x "H" x "\^N\^N\^F\^[H"
x "" x "\^A\^P\^E"
x "<" x "\^C\^C\^[<"
x "" x "\^N\^E"
x ">" x "\^[>\^P\^O"
x "\0" x "\0\^E\^F\^E"
x)) x))
;;Sorting of columns ;;Sorting of columns
(fset 'ses-exercise-sort-column (fset 'ses-exercise-sort-column
(concat y ":(revert-buffer t t)\r" (concat y "\^[:(revert-buffer t t)\r"
x "\"Very long\r" x "\"Very long\r"
x "99\r" x "\^F99\r"
x "o13\r" x "\^F\^[o13\r"
x "(+ A3 B3\r" x "(+ A3 B3\r"
x "7\r8\r(* A4 B4\r" x "7\r8\r(* A4 B4\r"
x "\0A\r" x "\0\^P\^P\^P\^C\^[\^SA\r"
x "\0B\r" x "\^N\0\^P\^P\^P\^C\^[\^SB\r"
x "\0C\r" x "\^P\^P\^F\0\^N\^N\^F\^F\^C\^[\^SC\r"
x "o" x "\^F\^[o\^P\^O"
x "\0C\r" x "\^B\0\^N\^N\^N\^U\^C\^[\^SC\r"
x)) x))
;;Simple cell printers ;;Simple cell printers
(fset 'ses-exercise-cell-printers (fset 'ses-exercise-cell-printers
(concat y ":(revert-buffer t t)\r" (concat y "\^[:(revert-buffer t t)\r"
x "\"4\t76\r" x "\^F\"4\^Q\t76\r\^B"
x "\"4\n7\r" x "\"4\^Q\n7\r\^B"
x "p\"{%S}\"\r" x "p\"{%S}\"\r"
x "p(\"[%s]\")\r" x "p(\"[%s]\")\r"
x "p(\"<%s>\")\r" x "p(\"<%s>\")\r"
x "\0" x "\^B\0\^F\^F"
x "p\r" x "p\r"
x "pnil\r" x "pnil\r"
x "pses-dashfill\r" x "pses-dashfill\r"
x "48\r" x "48\r\^B"
x "\t" x "\t"