Commit 7ed9159a authored by Jonathan Yavner's avatar Jonathan Yavner
Browse files

New major mode "SES" for spreadsheets.

New function (unsafep X) determines whether X is a safe Lisp form.
New support module testcover.el for coverage testing.
parent 6209bd8c
2002-09-16 Jonathan Yavner <jyavner@engineer.com>
* ses-example.ses: New file: example spreadsheet.
2002-09-04 Kenichi Handa <handa@etl.go.jp>
* HELLO: Fix Unicode Greek line.
......
Sales summary - Acme fundraising
~~~~~~~~~~~~~Summary~~~~~~~~~~~~~
--Totals-- Average
Eastern-area $46.70 2 $23.35
West-district $80.25 10 $8.03
North&South $99.69 5 $19.94
TOTAL ~$227 17 $13.33
= = = = = =Details = = = = = =
99/07/25 North&South $40.00
99/08/16 West-district $5.25
99/08/16 North&South $12.99
99/08/25 West-district $8.61
99/08/26 West-district $9.97
99/09/04 Eastern-area $21.00
00/01/15 West-district $5.50
00/07/15 West-district $19.01
00/07/26 North&South $27.95
00/08/04 West-district $11.71
00/08/16 Eastern-area $25.70
00/08/25 West-district $4.95
00/08/26 West-district $7.21
00/09/01 North&South $1.25
01/07/25 West-district $5.75
01/08/04 West-district $2.29
01/08/15 North&South $17.50
(ses-cell A1 "Sales summary - Acme fundraising" "Sales summary - Acme fundraising" nil nil)
(ses-cell B1 *skip* nil nil nil)
(ses-cell C1 *skip* nil nil nil)
(ses-cell D1 *skip* nil nil nil)
(ses-cell E1 nil nil nil nil)
(ses-cell A2 nil nil nil nil)
(ses-cell B2 nil nil nil nil)
(ses-cell C2 nil nil nil nil)
(ses-cell D2 nil nil nil nil)
(ses-cell E2 nil nil nil nil)
(ses-cell A3 nil nil nil nil)
(ses-cell B3 "Summary" "Summary" ses-tildefill-span nil)
(ses-cell C3 *skip* nil nil nil)
(ses-cell D3 *skip* nil nil nil)
(ses-cell E3 *skip* nil nil nil)
(ses-cell A4 nil nil nil nil)
(ses-cell B4 nil nil nil nil)
(ses-cell C4 "Totals" "Totals" ses-dashfill-span nil)
(ses-cell D4 *skip* nil nil nil)
(ses-cell E4 "Average" "Average" nil nil)
(ses-cell A5 nil nil nil nil)
(ses-cell B5 Eastern-area (quote Eastern-area) nil nil)
(ses-cell C5 46.7 (apply (quote +) (ses-select (ses-range B11 B27) (quote Eastern-area) (ses-range C11 C27))) nil (C8 E5))
(ses-cell D5 2 (length (ses-select (ses-range B11 B27) (quote Eastern-area) (ses-range C11 C27))) nil (D8 E5))
(ses-cell E5 23.35 (/ C5 D5) nil nil)
(ses-cell A6 nil nil nil nil)
(ses-cell B6 West-district (quote West-district) nil nil)
(ses-cell C6 80.25 (apply (quote +) (ses-select (ses-range B11 B27) (quote West-district) (ses-range C11 C27))) nil (C8 E6))
(ses-cell D6 10 (length (ses-select (ses-range B11 B27) (quote West-district) (ses-range C11 C27))) nil (D8 E6))
(ses-cell E6 8.025 (/ C6 D6) nil nil)
(ses-cell A7 nil nil nil nil)
(ses-cell B7 North&South (quote North&South) nil nil)
(ses-cell C7 99.69 (apply (quote +) (ses-select (ses-range B11 B27) (quote North&South) (ses-range C11 C27))) nil (C8 E7))
(ses-cell D7 5 (length (ses-select (ses-range B11 B27) (quote North&South) (ses-range C11 C27))) nil (D8 E7))
(ses-cell E7 19.938 (/ C7 D7) nil nil)
(ses-cell A8 nil nil nil nil)
(ses-cell B8 "TOTAL" "TOTAL" nil nil)
(ses-cell C8 226.64 (ses+ C5 C6 C7) "~$%.0f" (E8))
(ses-cell D8 17 (ses+ D5 D6 D7) nil (E8))
(ses-cell E8 13.331764705882351 (/ C8 D8) nil nil)
(ses-cell A9 nil nil ses-center nil)
(ses-cell B9 useless (quote useless) (lambda (x) (if (eq x (quote useless)) "" (prin1-to-string x))) nil)
(ses-cell C9 nil nil nil nil)
(ses-cell D9 nil nil nil nil)
(ses-cell E9 nil nil nil nil)
(ses-cell A10 "Details " "Details " (lambda (x) (replace-regexp-in-string "==" "= " (ses-center-span x 61))) nil)
(ses-cell B10 *skip* nil nil nil)
(ses-cell C10 *skip* nil nil nil)
(ses-cell D10 "" "" nil nil)
(ses-cell E10 nil nil nil nil)
(ses-cell A11 990725 990725 nil nil)
(ses-cell B11 North&South (quote North&South) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C11 40 40 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D11 nil nil nil nil)
(ses-cell E11 nil nil nil nil)
(ses-cell A12 990816 990816 nil nil)
(ses-cell B12 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C12 5.25 5.25 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D12 nil nil nil nil)
(ses-cell E12 nil nil nil nil)
(ses-cell A13 990816 990816 nil nil)
(ses-cell B13 North&South (quote North&South) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C13 12.99 12.99 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D13 nil nil nil nil)
(ses-cell E13 nil nil nil nil)
(ses-cell A14 990825 990825 nil nil)
(ses-cell B14 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C14 8.61 8.61 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D14 nil nil nil nil)
(ses-cell E14 nil nil nil nil)
(ses-cell A15 990826 990826 nil nil)
(ses-cell B15 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C15 9.97 9.97 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D15 nil nil nil nil)
(ses-cell E15 nil nil nil nil)
(ses-cell A16 990904 990904 nil nil)
(ses-cell B16 Eastern-area (quote Eastern-area) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C16 21 (/ life-universe-everything 2) nil (D7 C7 D6 C6 D5 C5))
(ses-cell D16 nil nil nil nil)
(ses-cell E16 nil nil nil nil)
(ses-cell A17 115 115 nil nil)
(ses-cell B17 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C17 5.5 5.5 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D17 nil nil nil nil)
(ses-cell E17 nil nil nil nil)
(ses-cell A18 715 715 nil nil)
(ses-cell B18 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C18 19.01 19.01 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D18 nil nil nil nil)
(ses-cell E18 nil nil nil nil)
(ses-cell A19 726 726 nil nil)
(ses-cell B19 North&South (quote North&South) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C19 27.95 27.95 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D19 nil nil nil nil)
(ses-cell E19 nil nil nil nil)
(ses-cell A20 804 804 nil nil)
(ses-cell B20 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C20 11.71 11.71 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D20 nil nil nil nil)
(ses-cell E20 nil nil nil nil)
(ses-cell A21 816 816 nil nil)
(ses-cell B21 Eastern-area (quote Eastern-area) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C21 25.7 25.7 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D21 nil nil nil nil)
(ses-cell E21 nil nil nil nil)
(ses-cell A22 825 825 nil nil)
(ses-cell B22 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C22 4.95 4.95 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D22 nil nil nil nil)
(ses-cell E22 nil nil nil nil)
(ses-cell A23 826 826 nil nil)
(ses-cell B23 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C23 7.21 7.21 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D23 nil nil nil nil)
(ses-cell E23 nil nil nil nil)
(ses-cell A24 901 901 nil nil)
(ses-cell B24 North&South (quote North&South) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C24 1.25 1.25 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D24 nil nil nil nil)
(ses-cell E24 nil nil nil nil)
(ses-cell A25 10725 10725 nil nil)
(ses-cell B25 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C25 5.75 5.75 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D25 nil nil nil nil)
(ses-cell E25 nil nil nil nil)
(ses-cell A26 10804 10804 nil nil)
(ses-cell B26 West-district (quote West-district) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C26 2.29 2.29 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D26 nil nil nil nil)
(ses-cell E26 nil nil nil nil)
(ses-cell A27 10815 10815 nil nil)
(ses-cell B27 North&South (quote North&South) nil (D7 C7 D6 C6 D5 C5))
(ses-cell C27 17.5 17.5 nil (D7 C7 D6 C6 D5 C5))
(ses-cell D27 nil nil nil nil)
(ses-cell E27 nil nil nil nil)
(ses-column-widths [8 14 6 3 7])
(ses-column-printers [(lambda (x) (format "%02d/%02d/%02d" (/ x 10000) (% (/ x 100) 100) (% x 100))) ("%s") "$%.2f" nil "$%.2f"])
(ses-default-printer "%.7g")
(ses-header-row 0)
( ;Global parameters (these are read first)
2 ;SES file-format
27 ;numrows
5 ;numcols
)
;;; Local Variables:
;;; mode: ses
;;; life-universe-everything: 42
;;; symbolic-formulas: (("Eastern area") ("West-district") ("North&South") ("Other"))
;;; End:
......@@ -895,6 +895,17 @@
* viper.el (viper-emacs-state-mode-list): Added modes.
2002-09-18 Jonathan Yavner <jyavner@engineer.com>
* emacs-lisp/testcover.el: New file. Uses edebug to instrument a
module of code, with graphical display of poor-coverage spots.
* emacs-lisp/testcover-ses.el: New file. Demonstrates use of
testcover on a interactive module like ses.
* emacs-lisp/testcover-unsafep.el: New file. Demonstrates use of
testcover on a noninteractive module like unsafep.
2002-09-18 Miles Bader <miles@gnu.org>
* diff-mode.el (diff-mode): Don't evaluate `compilation-last-buffer'
......@@ -909,6 +920,21 @@
Don't output the C-x # message if `nowait'.
(server-buffer-done): Use server-log's new arg.
2002-09-16 Jonathan Yavner <jyavner@engineer.com>
* ses.el: New file.
* emacs-lisp/unsafep.el: New file.
* files.el (auto-mode-alist): Add ".ses" for ses-mode.
(inhibit-quit): This is risky for unsafep, doesn't matter much for
anybody else.
(risky-local-variable-p): New function. Split off from
hack-one-local-variable so unsafep can use it. Add \|-history$ to
the list of disallowed local variable names (malicious user could
stuff a `display' property in there that would be activated when
na,Ao(Bve user called up the history).
2002-09-16 Markus Rost <rost@math.ohio-state.edu>
* ls-lisp.el (ls-lisp-format-time-list): Fix type and provide :tag's.
......
......@@ -37,8 +37,8 @@
(put 'ps-print-vertical 'custom-loads '("ps-print"))
(put 'supercite-hooks 'custom-loads '("supercite"))
(put 'vhdl-menu 'custom-loads '("vhdl-mode"))
(put 'chinese-calendar 'custom-loads '("cal-china"))
(put 'gnus-newsrc 'custom-loads '("gnus-start"))
(put 'chinese-calendar 'custom-loads '("cal-china"))
(put 'expand 'custom-loads '("expand"))
(put 'bookmark 'custom-loads '("bookmark"))
(put 'icon 'custom-loads '("icon"))
......@@ -221,8 +221,8 @@
(put 'auto-save 'custom-loads '("files" "startup"))
(put 'tpu 'custom-loads '("tpu-edt" "tpu-extras"))
(put 'w32 'custom-loads '("w32-vars"))
(put 'viper-hooks 'custom-loads '("viper-init"))
(put 'gnus-cite 'custom-loads '("gnus-cite"))
(put 'viper-hooks 'custom-loads '("viper-init"))
(put 'gnus-demon 'custom-loads '("gnus-demon"))
(put 'reftex-optimizations-for-large-documents 'custom-loads '("reftex-vars"))
(put 'viper-misc 'custom-loads '("viper-cmd" "viper-init" "viper"))
......@@ -265,18 +265,20 @@
(put 'ps-print 'custom-loads '("ps-print"))
(put 'view 'custom-loads '("view" "calendar"))
(put 'cwarn 'custom-loads '("cwarn"))
(put 'testcover 'custom-loads '("testcover"))
(put 'gnus-score-default 'custom-loads '("gnus-score" "gnus-sum"))
(put 'ebnf-except 'custom-loads '("ebnf2ps"))
(put 'nnmail-duplicate 'custom-loads '("nnmail"))
(put 'handwrite 'custom-loads '("handwrite"))
(put 'tags 'custom-loads '("speedbar"))
(put 'ses 'custom-loads '("ses"))
(put 'eshell-proc 'custom-loads '("esh-proc"))
(put 'custom-browse 'custom-loads '("cus-edit"))
(put 'mime 'custom-loads '("mailcap" "mm-bodies"))
(put 'generic-x 'custom-loads '("generic-x"))
(put 'partial-completion 'custom-loads '("complete"))
(put 'whitespace 'custom-loads '("whitespace"))
(put 'maint 'custom-loads '("emacsbug" "gulp" "lisp-mnt"))
(put 'maint 'custom-loads '("gulp" "lisp-mnt" "emacsbug"))
(put 'pages 'custom-loads '("page-ext"))
(put 'message-interface 'custom-loads '("message"))
(put 'diary 'custom-loads '("calendar" "diary-lib" "solar"))
......@@ -374,8 +376,8 @@
(put 'log-view 'custom-loads '("log-view"))
(put 'PostScript 'custom-loads '("ps-mode"))
(put 'abbrev-mode 'custom-loads '("abbrev" "cus-edit" "mailabbrev"))
(put 'eshell-term 'custom-loads '("em-term"))
(put 'earcon 'custom-loads '("earcon"))
(put 'eshell-term 'custom-loads '("em-term"))
(put 'feedmail-headers 'custom-loads '("feedmail"))
(put 'hypermedia 'custom-loads '("wid-edit" "metamail" "browse-url" "goto-addr"))
(put 'image 'custom-loads '("image-file"))
......@@ -466,14 +468,14 @@
(put 'bibtex 'custom-loads '("bibtex"))
(put 'faces 'custom-loads '("faces" "loaddefs" "facemenu" "cus-edit" "font-lock" "hilit-chg" "paren" "ps-print" "speedbar" "time" "whitespace" "wid-edit" "woman" "gnus" "message" "cwarn" "make-mode"))
(put 'gnus-summary-various 'custom-loads '("gnus-sum"))
(put 'applications 'custom-loads '("calendar" "cus-edit" "uniquify" "eshell" "spell"))
(put 'applications 'custom-loads '("calendar" "cus-edit" "ses" "uniquify" "eshell" "spell"))
(put 'ebrowse-member 'custom-loads '("ebrowse"))
(put 'terminal 'custom-loads '("terminal"))
(put 'shadow 'custom-loads '("shadowfile" "shadow"))
(put 'hl-line 'custom-loads '("hl-line"))
(put 'eshell-glob 'custom-loads '("em-glob"))
(put 'internal 'custom-loads '("startup" "cus-edit" "delim-col"))
(put 'lisp 'custom-loads '("simple" "lisp" "lisp-mode" "ielm" "xscheme" "advice" "bytecomp" "checkdoc" "cl-indent" "cust-print" "edebug" "eldoc" "elp" "find-func" "pp" "re-builder" "shadow" "trace" "scheme"))
(put 'lisp 'custom-loads '("simple" "lisp" "lisp-mode" "ielm" "unsafep" "xscheme" "advice" "bytecomp" "checkdoc" "cl-indent" "cust-print" "edebug" "eldoc" "elp" "find-func" "pp" "re-builder" "shadow" "testcover" "trace" "scheme"))
(put 'local 'custom-loads '("calendar"))
(put 'rlogin 'custom-loads '("rlogin"))
(put 'debugger 'custom-loads '("debug"))
......@@ -848,10 +850,14 @@ as a PDF file <URL:http://www.ecma.ch/ecma1/STAND/ECMA-048.HTM>.")
(custom-put-if-not 'sql-db2-options 'standard-value t)
(custom-put-if-not 'cwarn 'custom-version "21.1")
(custom-put-if-not 'cwarn 'group-documentation "Highlight suspicious C and C++ constructions.")
(custom-put-if-not 'testcover 'custom-version "21.1")
(custom-put-if-not 'testcover 'group-documentation "Code-coverage tester")
(custom-put-if-not 'sgml-xml-mode 'custom-version "21.4")
(custom-put-if-not 'sgml-xml-mode 'standard-value t)
(custom-put-if-not 'message-buffer-naming-style 'custom-version "21.1")
(custom-put-if-not 'message-buffer-naming-style 'standard-value t)
(custom-put-if-not 'ses 'custom-version "21.1")
(custom-put-if-not 'ses 'group-documentation "Simple Emacs Spreadsheet")
(custom-put-if-not 'ps-footer-font-size 'custom-version "21.1")
(custom-put-if-not 'ps-footer-font-size 'standard-value t)
(custom-put-if-not 'hscroll-margin 'custom-version "21.3")
......@@ -872,10 +878,10 @@ as a PDF file <URL:http://www.ecma.ch/ecma1/STAND/ECMA-048.HTM>.")
(custom-put-if-not 'vc-diff-switches 'standard-value t)
(custom-put-if-not 'vcursor-interpret-input 'custom-version "20.3")
(custom-put-if-not 'vcursor-interpret-input 'standard-value t)
(custom-put-if-not 'diary-sabbath-candles-minutes 'custom-version "21.1")
(custom-put-if-not 'diary-sabbath-candles-minutes 'standard-value t)
(custom-put-if-not 'gnus-audio 'custom-version "21.1")
(custom-put-if-not 'gnus-audio 'group-documentation "Playing sound in Gnus.")
(custom-put-if-not 'diary-sabbath-candles-minutes 'custom-version "21.1")
(custom-put-if-not 'diary-sabbath-candles-minutes 'standard-value t)
(custom-put-if-not 'trailing-whitespace 'custom-version "21.1")
(custom-put-if-not 'trailing-whitespace 'group-documentation nil)
(custom-put-if-not 'fortran-comment-line-start 'custom-version "21.1")
......
;;;; testcover-ses.el -- Example use of `testcover' to test "SES"
;; Copyright (C) 2002 Free Software Foundation, Inc.
;; Author: Jonathan Yavner <jyavner@engineer.com>
;; Maintainer: Jonathan Yavner <jyavner@engineer.com>
;; Keywords: spreadsheet lisp utility
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
(require 'testcover)
;;;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 "q" ""))
(y "ses-test.ses\r<"))
;;Fiddle with the existing spreadsheet
(fset 'ses-exercise-example
(concat "" data-directory "ses-example.ses\r<"
x "10"
x " "
x ""
x "pses-center\r"
x "p\r"
x "\t\t"
x "\r A9 B9\r"
x ""
x "\r 2\r"
x ""
x "50\r"
x "4"
x " "
x ""
x "(+ o\0"
x "-1o \r"
x ""
x))
;;Create a new spreadsheet
(fset 'ses-exercise-new
(concat y
x "\"%.8g\"\r"
x "2\r"
x ""
x ""
x "2"
x "\"Header\r"
x "(sqrt 1\r"
x "pses-center\r"
x "\t"
x "(+ A2 A3\r"
x "(* B2 A3\r"
x "2"
x "\rB3\r"
x ""
x))
;;Basic cell display
(fset 'ses-exercise-display
(concat y ":(revert-buffer t t)\r"
x ""
x "\"Very long\r"
x "w3\r"
x "w3\r"
x "(/ 1 0\r"
x "234567\r"
x "5w"
x "\t1\r"
x ""
x "234567\r"
x "\t"
x ""
x "345678\r"
x "3w"
x "\0>"
x ""
x ""
x ""
x ""
x ""
x ""
x ""
x "1\r"
x ""
x ""
x "\"1234567-1234567-1234567\r"
x "123\r"
x "2"
x "\"1234567-1234567-1234567\r"
x "123\r"
x "w8\r"
x "\"1234567\r"
x "w5\r"
x))
;;Cell formulas
(fset 'ses-exercise-formulas
(concat y ":(revert-buffer t t)\r"
x "\t\t"
x "\t"
x "(* B1 B2 D1\r"
x "(* B2 B3\r"
x "(apply '+ (ses-range B1 B3)\r"
x "(apply 'ses+ (ses-range B1 B3)\r"
x "(apply 'ses+ (ses-range A2 A3)\r"
x "(mapconcat'number-to-string(ses-range B2 B4) \"-\"\r"
x "(apply 'concat (reverse (ses-range A3 D3))\r"
x "(* (+ A2 A3) (ses+ B2 B3)\r"
x ""
x "2"
x "5\t"
x "(apply 'ses+ (ses-range E1 E2)\r"
x "(apply 'ses+ (ses-range A5 B5)\r"
x "(apply 'ses+ (ses-range E1 F1)\r"
x "(apply 'ses+ (ses-range D1 E1)\r"
x "\t"
x "(ses-average (ses-range A2 A5)\r"
x "(apply 'ses+ (ses-range A5 A6)\r"
x "k"
x " "
x ""
x "2"
x "3 "
x "o"
x "2o"
x "3k"
x "(ses-average (ses-range B3 E3)\r"
x "k"
x "12345678\r"
x))
;;Recalculating and reconstructing
(fset 'ses-exercise-recalc
(concat y ":(revert-buffer t t)\r"
x " "
x "\t\t"
x ""
x "(/ 1 0\r"
x ""
x "\n"
x ""
x "\"%.6g\"\r"
x " "
x ">nw"
x "\0>xdelete-region\r"
x " "
x "8"
x "\0>xdelete-region\r"
x " "
x ""
x " k"
x " "
x "\"Very long\r"
x ""
x "\r\r"
x ""
x "o"
x ""
x "\"Very long2\r"
x "o"
x ""
x "\rC3\r"
x "\rC2\r"
x "\0"
x "\rC4\r"
x "\rC2\r"
x "\0"
x ""
x "xses-mode\r"
x "<"
x "2k"
x))
;;Header line
(fset 'ses-exercise-header-row
(concat y ":(revert-buffer t t)\r"
x "<"
x ">"
x "6<"
x ">"
x "7<"
x ">"
x "8<"
x "2<"
x ">"
x "3w"
x "10<"
x ">"
x "2 "
x))
;;Detecting unsafe formulas and printers
(fset 'ses-exercise-unsafe
(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 "\0n"
x "(delete-file \"x\"\rn"
x "(delete-file \"ses-nothing\"\ry"
x "\0n"
x "(open-network-stream \"x\" nil \"localhost\" \"smtp\"\ry"
x "\0n"
x))
;;Inserting and deleting rows
(fset 'ses-exercise-rows
(concat y ":(revert-buffer t t)\r"
x ""
x "\"%s=\"\r"
x "20"
x "p\"%s+\"\r"
x ""
x "123456789\r"
x "\021"
x ""
x " "
x "(not B25\r"
x "k"
x "jA3\r"
x "19 "
x " "
x "100" ;Make this approx your CPU speed in MHz
x))
;;Inserting and deleting columns
(fset 'ses-exercise-columns
(concat y ":(revert-buffer t t)\r"
x "\"%s@\"\r"
x "o"
x ""
x "o"
x " "
x "k"
x "w8\r"
x "p\"%.7s*\"\r"
x "o"
x ""
x "2o"
x "3k"
x "\"%.6g\"\r"
x "26o"
x "\026\t"
x "26o"
x "0\r"
x "26\t"
x "400"
x "50k"
x "\0D"
x))
(fset 'ses-exercise-editing
(concat y ":(revert-buffer t t)\r"
x "1\r"
x "('x\r"
x ""
x ""
x "\r\r"
x "w9\r"
x "\r.5\r"
x "\r 10\r"
x "w12\r"
x "\r'\r"
x "\r\r"
x "jA4\r"
x "(+ A2 100\r"
x "3\r"
x "jB1\r"
x "(not A1\r"
x "\"Very long\r"
x ""
x "h"
x "H"
x ""
x ">\t"
x ""
x ""
x "2"