2002-09-28 18:45:56 +00:00
|
|
|
;;;; testcover-ses.el -- Example use of `testcover' to test "SES"
|
|
|
|
|
2020-01-01 00:19:43 +00:00
|
|
|
;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
|
2002-09-28 18:45:56 +00:00
|
|
|
|
2019-05-19 21:29:13 -07:00
|
|
|
;; Author: Jonathan Yavner <jyavner@member.fsf.org>
|
2002-09-28 18:45:56 +00:00
|
|
|
;; Keywords: spreadsheet lisp utility
|
2010-08-29 12:17:13 -04:00
|
|
|
;; Package: testcover
|
2002-09-28 18:45:56 +00:00
|
|
|
|
2008-05-06 03:21:21 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2002-09-28 18:45:56 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 03:21:21 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
2002-09-28 18:45:56 +00:00
|
|
|
|
|
|
|
;; 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
|
2017-09-13 15:52:52 -07:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2002-09-28 18:45:56 +00:00
|
|
|
|
|
|
|
(require 'testcover)
|
|
|
|
|
2005-08-29 10:46:03 +00:00
|
|
|
(defvar ses-initial-global-parameters)
|
|
|
|
(defvar ses-mode-map)
|
|
|
|
|
2007-12-06 04:06:27 +00:00
|
|
|
(declare-function ses-set-curcell "ses")
|
|
|
|
(declare-function ses-update-cells "ses")
|
|
|
|
(declare-function ses-load "ses")
|
|
|
|
(declare-function ses-vector-delete "ses")
|
|
|
|
(declare-function ses-create-header-string "ses")
|
|
|
|
(declare-function ses-read-cell "ses")
|
|
|
|
(declare-function ses-read-symbol "ses")
|
|
|
|
(declare-function ses-command-hook "ses")
|
|
|
|
(declare-function ses-jump "ses")
|
* progmodes/python.el (info-lookup-maybe-add-help):
* progmodes/ps-mode.el (doc-view-minor-mode):
* mail/emacsbug.el (Info-menu, Info-goto-node):
* emulation/viper-keym.el (viper-ex)
(viper-normalize-minor-mode-map-alist, viper-set-mode-vars-for):
* emulation/viper-cmd.el (widget-type, widget-button-press)
(viper-set-hooks):
* emacs-lisp/tcover-unsafep.el (unsafep-function):
* emacs-lisp/tcover-ses.el (ses-set-curcell, ses-update-cells)
(ses-load, ses-vector-delete, ses-create-header-string)
(ses-read-cell, ses-read-symbol, ses-command-hook, ses-jump):
* emacs-lisp/gulp.el (mail-subject, mail-send): Declare as
functions.
* url-mailto.el (mail-send-and-exit):
* url-http.el (url-dav-file-attributes):
* url-file.el (ange-ftp-set-passwd, ange-ftp-copy-file-internal):
(url-generate-unique-filename): Declare as functions.
2007-11-20 07:56:02 +00:00
|
|
|
|
|
|
|
|
2002-09-28 18:45:56 +00:00
|
|
|
;;;Here are some macros that exercise SES. Set `pause' to t if you want the
|
|
|
|
;;;macros to pause after each step.
|
|
|
|
(let* ((pause nil)
|
2018-03-29 17:41:11 -07:00
|
|
|
(x (if pause "\^Xq" ""))
|
|
|
|
(y "\^X\^Fses-test.ses\r\^[<"))
|
2002-09-28 18:45:56 +00:00
|
|
|
;;Fiddle with the existing spreadsheet
|
|
|
|
(fset 'ses-exercise-example
|
2018-03-29 17:41:11 -07:00
|
|
|
(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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "50\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
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 "\^_"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Create a new spreadsheet
|
|
|
|
(fset 'ses-exercise-new
|
|
|
|
(concat y
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^C\^P\"%.8g\"\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "2\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^O"
|
|
|
|
x "\^P"
|
|
|
|
x "\^U2\^O"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\"Header\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "(sqrt 1\r\^B"
|
|
|
|
x "pses-center\r\^F"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\t"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^P(+ A2 A3\r"
|
|
|
|
x "\^F(* B2 A3\r"
|
|
|
|
x "\^U2\^C\^[\^H"
|
|
|
|
x "\r\^?\^?\^?B3\r"
|
|
|
|
x "\^X\^S"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Basic cell display
|
|
|
|
(fset 'ses-exercise-display
|
2018-03-29 17:41:11 -07:00
|
|
|
(concat y "\^[:(revert-buffer t t)\r"
|
|
|
|
x "\^E"
|
|
|
|
x "\"Very long\r\^B"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "w3\r"
|
|
|
|
x "w3\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Cell formulas
|
|
|
|
(fset 'ses-exercise-formulas
|
2018-03-29 17:41:11 -07:00
|
|
|
(concat y "\^[:(revert-buffer t t)\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\t\t"
|
|
|
|
x "\t"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\t"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Recalculating and reconstructing
|
|
|
|
(fset 'ses-exercise-recalc
|
2018-03-29 17:41:11 -07:00
|
|
|
(concat y "\^[:(revert-buffer t t)\r"
|
|
|
|
x "\^C\^[\^L"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\t\t"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^C\^C"
|
|
|
|
x "(/ 1 0\r\^B"
|
|
|
|
x "\^C\^C"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\n"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Header line
|
|
|
|
(fset 'ses-exercise-header-row
|
2018-03-29 17:41:11 -07:00
|
|
|
(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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Detecting unsafe formulas and printers
|
|
|
|
(fset 'ses-exercise-unsafe
|
2018-03-29 17:41:11 -07:00
|
|
|
(concat y "\^[:(revert-buffer t t)\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "p(lambda (x) (delete-file x))\rn"
|
|
|
|
x "p(lambda (x) (delete-file \"ses-nothing\"))\ry"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Inserting and deleting rows
|
|
|
|
(fset 'ses-exercise-rows
|
2018-03-29 17:41:11 -07:00
|
|
|
(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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "jA3\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^U19\^K"
|
|
|
|
x "\^P\^F\^K"
|
|
|
|
x "\^U100\^O" ;Make this approx your CPU speed in MHz
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Inserting and deleting columns
|
|
|
|
(fset 'ses-exercise-columns
|
2018-03-29 17:41:11 -07:00
|
|
|
(concat y "\^[:(revert-buffer t t)\r"
|
|
|
|
x "\^C\^P\"%s@\"\r"
|
|
|
|
x "\^[o"
|
|
|
|
x "\^O"
|
|
|
|
x "\^[o"
|
|
|
|
x "\^K"
|
|
|
|
x "\^[k"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "w8\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
(fset 'ses-exercise-editing
|
2018-03-29 17:41:11 -07:00
|
|
|
(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 "\^_"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\r\r"
|
|
|
|
x "w9\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^N\r\^B.5\r"
|
|
|
|
x "\^N\^F\r\^B 10\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "w12\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\r\^A'\r"
|
|
|
|
x "\r\^A\^D\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "jA4\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "(+ A2 100\r\^B"
|
|
|
|
x "\^P\^P3\r\^B"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "jB1\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Sorting of columns
|
|
|
|
(fset 'ses-exercise-sort-column
|
2018-03-29 17:41:11 -07:00
|
|
|
(concat y "\^[:(revert-buffer t t)\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\"Very long\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^F99\r"
|
|
|
|
x "\^F\^[o13\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "(+ A3 B3\r"
|
|
|
|
x "7\r8\r(* A4 B4\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Simple cell printers
|
|
|
|
(fset 'ses-exercise-cell-printers
|
2018-03-29 17:41:11 -07:00
|
|
|
(concat y "\^[:(revert-buffer t t)\r"
|
|
|
|
x "\^F\"4\^Q\t76\r\^B"
|
|
|
|
x "\"4\^Q\n7\r\^B"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "p\"{%S}\"\r"
|
|
|
|
x "p(\"[%s]\")\r"
|
|
|
|
x "p(\"<%s>\")\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^B\0\^F\^F"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "p\r"
|
|
|
|
x "pnil\r"
|
|
|
|
x "pses-dashfill\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "48\r\^B"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\t"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^B\0\^Fp\r"
|
|
|
|
x "\^Fp\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "pses-dashfill\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^B\0\^F\^Fpnil\r"
|
|
|
|
x "5\r\^B"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "pses-center\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^C\^P\"%s\"\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "w8\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Spanning cell printers
|
|
|
|
(fset 'ses-exercise-spanning-printers
|
2018-03-29 17:41:11 -07:00
|
|
|
(concat y "\^[:(revert-buffer t t)\r"
|
|
|
|
x "\^[p\"%.6g*\"\r"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "pses-dashfill-span\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "5\r\^B"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "pses-tildefill-span\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "pses-dashfill-span\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\"23456789\r\^B"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\t"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "(not t\r\^B"
|
|
|
|
x "\^Bw6\r"
|
|
|
|
x "\"5\r\^B"
|
|
|
|
x "\^N\^F\^[o"
|
|
|
|
x "\^[k"
|
|
|
|
x "\^[k"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "\t"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^B\^P\^C\^C"
|
|
|
|
x "\^[o"
|
|
|
|
x "\^N\^U2\^[k"
|
|
|
|
x "\^B\^B\^[k"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Cut/copy/paste - within same buffer
|
|
|
|
(fset 'ses-exercise-paste-1buf
|
2018-03-29 17:41:11 -07:00
|
|
|
(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 "\^[<"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "p\"<%s>\"\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "pses-tildefill-span\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
x "\^N\^F\"Subline A(1)\r\^B"
|
2002-09-28 18:45:56 +00:00
|
|
|
x "pses-dashfill-span\r"
|
2018-03-29 17:41:11 -07:00
|
|
|
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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Cut/copy/paste - between two buffers
|
|
|
|
(fset 'ses-exercise-paste-2buf
|
2018-03-29 17:41:11 -07:00
|
|
|
(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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x))
|
|
|
|
;;Export text, import it back
|
|
|
|
(fset 'ses-exercise-import-export
|
2018-03-29 17:41:11 -07:00
|
|
|
(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"
|
2002-09-28 18:45:56 +00:00
|
|
|
x)))
|
|
|
|
|
|
|
|
(defun ses-exercise-macros ()
|
|
|
|
"Executes all SES coverage-test macros."
|
|
|
|
(dolist (x '(ses-exercise-example
|
|
|
|
ses-exercise-new
|
|
|
|
ses-exercise-display
|
|
|
|
ses-exercise-formulas
|
|
|
|
ses-exercise-recalc
|
|
|
|
ses-exercise-header-row
|
|
|
|
ses-exercise-unsafe
|
|
|
|
ses-exercise-rows
|
|
|
|
ses-exercise-columns
|
|
|
|
ses-exercise-editing
|
|
|
|
ses-exercise-sort-column
|
|
|
|
ses-exercise-cell-printers
|
|
|
|
ses-exercise-spanning-printers
|
|
|
|
ses-exercise-paste-1buf
|
|
|
|
ses-exercise-paste-2buf
|
|
|
|
ses-exercise-import-export))
|
|
|
|
(message "<Testing %s>" x)
|
|
|
|
(execute-kbd-macro x)))
|
|
|
|
|
|
|
|
(defun ses-exercise-signals ()
|
|
|
|
"Exercise code paths that lead to error signals, other than those for
|
|
|
|
spreadsheet files with invalid formatting."
|
|
|
|
(message "<Checking for expected errors>")
|
|
|
|
(switch-to-buffer "ses-test.ses")
|
|
|
|
(deactivate-mark)
|
|
|
|
(ses-jump 'A1)
|
|
|
|
(ses-set-curcell)
|
|
|
|
(dolist (x '((ses-column-widths 14)
|
|
|
|
(ses-column-printers "%s")
|
|
|
|
(ses-column-printers ["%s" "%s" "%s"]) ;Should be two
|
|
|
|
(ses-column-widths [14])
|
|
|
|
(ses-delete-column -99)
|
|
|
|
(ses-delete-column 2)
|
|
|
|
(ses-delete-row -1)
|
|
|
|
(ses-goto-data 'hogwash)
|
|
|
|
(ses-header-row -56)
|
|
|
|
(ses-header-row 99)
|
|
|
|
(ses-insert-column -14)
|
|
|
|
(ses-insert-row 0)
|
|
|
|
(ses-jump 'B8) ;Covered by preceding cell
|
|
|
|
(ses-printer-validate '("%s" t))
|
|
|
|
(ses-printer-validate '([47]))
|
|
|
|
(ses-read-header-row -1)
|
|
|
|
(ses-read-header-row 32767)
|
|
|
|
(ses-relocate-all 0 0 -1 1)
|
|
|
|
(ses-relocate-all 0 0 1 -1)
|
|
|
|
(ses-select (ses-range A1 A2) 'x (ses-range B1 B1))
|
|
|
|
(ses-set-cell 0 0 'hogwash nil)
|
|
|
|
(ses-set-column-width 0 0)
|
|
|
|
(ses-yank-cells #("a\nb"
|
|
|
|
0 1 (ses (A1 nil nil))
|
|
|
|
2 3 (ses (A3 nil nil)))
|
|
|
|
nil)
|
|
|
|
(ses-yank-cells #("ab"
|
|
|
|
0 1 (ses (A1 nil nil))
|
|
|
|
1 2 (ses (A2 nil nil)))
|
|
|
|
nil)
|
|
|
|
(ses-yank-pop nil)
|
|
|
|
(ses-yank-tsf "1\t2\n3" nil)
|
|
|
|
(let ((curcell nil)) (ses-check-curcell))
|
|
|
|
(let ((curcell 'A1)) (ses-check-curcell 'needrange))
|
|
|
|
(let ((curcell '(A1 . A2))) (ses-check-curcell 'end))
|
|
|
|
(let ((curcell '(A1 . A2))) (ses-sort-column "B"))
|
|
|
|
(let ((curcell '(C1 . D2))) (ses-sort-column "B"))
|
2018-03-29 17:41:11 -07:00
|
|
|
(execute-kbd-macro "jB10\n\^U2\^D")
|
2003-02-14 09:58:27 +00:00
|
|
|
(execute-kbd-macro [?j ?B ?9 ?\n ?\C-@ ?\C-f ?\C-f cut])
|
2018-03-29 17:41:11 -07:00
|
|
|
(progn (kill-new "x") (execute-kbd-macro "\^[>\^Yn"))
|
|
|
|
(execute-kbd-macro "\^B\0\^[w")))
|
2002-09-28 18:45:56 +00:00
|
|
|
(condition-case nil
|
|
|
|
(progn
|
|
|
|
(eval x)
|
|
|
|
(signal 'singularity-error nil)) ;Shouldn't get here
|
|
|
|
(singularity-error (error "No error from %s?" x))
|
|
|
|
(error nil)))
|
|
|
|
;;Test quit-handling in ses-update-cells. Cant' use `eval' here.
|
|
|
|
(let ((inhibit-quit t))
|
|
|
|
(setq quit-flag t)
|
|
|
|
(condition-case nil
|
|
|
|
(progn
|
|
|
|
(ses-update-cells '(A1))
|
|
|
|
(signal 'singularity-error nil))
|
|
|
|
(singularity-error (error "Quit failure in ses-update-cells"))
|
|
|
|
(error nil))
|
|
|
|
(setq quit-flag nil)))
|
|
|
|
|
|
|
|
(defun ses-exercise-invalid-spreadsheets ()
|
|
|
|
"Execute code paths that detect invalid spreadsheet files."
|
|
|
|
;;Detect invalid spreadsheets
|
2018-03-29 17:41:11 -07:00
|
|
|
(let ((p&d "\n\n\^L\n(ses-cell A1 nil nil nil nil)\n\n")
|
2002-09-28 18:45:56 +00:00
|
|
|
(cw "(ses-column-widths [7])\n")
|
|
|
|
(cp "(ses-column-printers [ses-center])\n")
|
|
|
|
(dp "(ses-default-printer \"%.7g\")\n")
|
|
|
|
(hr "(ses-header-row 0)\n")
|
|
|
|
(p11 "(2 1 1)")
|
|
|
|
(igp ses-initial-global-parameters))
|
|
|
|
(dolist (x (list "(1)"
|
|
|
|
"(x 2 3)"
|
|
|
|
"(1 x 3)"
|
|
|
|
"(1 -1 0)"
|
|
|
|
"(1 2 x)"
|
|
|
|
"(1 2 -1)"
|
|
|
|
"(3 1 1)"
|
2018-03-29 17:41:11 -07:00
|
|
|
"\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)"
|
2002-09-28 18:45:56 +00:00
|
|
|
(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)")
|
|
|
|
(concat p&d cw "(ses-column-printers)(x)\n(x)\n" p11)
|
|
|
|
(concat p&d cw cp "(x)\n(x)\n" p11)
|
|
|
|
(concat p&d cw cp "(ses-default-printer)(x)\n" p11)
|
|
|
|
(concat p&d cw cp dp "(x)\n" p11)
|
|
|
|
(concat p&d cw cp dp "(ses-header-row)" p11)
|
|
|
|
(concat p&d cw cp dp hr p11)
|
|
|
|
(concat p&d cw cp dp "\n" hr igp)))
|
|
|
|
(condition-case nil
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert x)
|
|
|
|
(ses-load)
|
|
|
|
(signal 'singularity-error nil)) ;Shouldn't get here
|
|
|
|
(singularity-error (error "%S is an invalid spreadsheet!" x))
|
|
|
|
(error nil)))))
|
|
|
|
|
|
|
|
(defun ses-exercise-startup ()
|
lisp/*.el: Fix typos and other trivial doc fixes
* lisp/allout-widgets.el (allout-widgets-auto-activation)
(allout-current-decorated-p):
* lisp/auth-source.el (auth-source-protocols):
* lisp/autorevert.el (auto-revert-set-timer):
* lisp/battery.el (battery-mode-line-limit):
* lisp/calc/calcalg3.el (math-map-binop):
* lisp/calendar/cal-dst.el (calendar-dst-find-startend):
* lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute):
* lisp/calendar/calendar.el (calendar-date-echo-text)
(calendar-generate-month, calendar-string-spread)
(calendar-cursor-to-date, calendar-read, calendar-read-date)
(calendar-mark-visible-date, calendar-dayname-on-or-before):
* lisp/calendar/diary-lib.el (diary-ordinal-suffix):
* lisp/cedet/ede/autoconf-edit.el (autoconf-new-program)
(autoconf-find-last-macro, autoconf-parameter-strip):
* lisp/cedet/ede/config.el (ede-target-with-config-build):
* lisp/cedet/ede/linux.el (ede-linux--detect-architecture)
(ede-linux--get-architecture):
* lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache)
(semantic-displayer-abstract, semantic-displayer-point-position):
* lisp/cedet/semantic/format.el (semantic-format-face-alist)
(semantic-format-tag-short-doc):
* lisp/cedet/semantic/fw.el (semantic-find-file-noselect):
* lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time)
(semantic-idle-breadcrumbs-display-function)
(semantic-idle-breadcrumbs-format-tag-list-function):
* lisp/cedet/semantic/lex.el (semantic-lex-map-types)
(define-lex, define-lex-block-type-analyzer):
* lisp/cedet/semantic/senator.el (senator-search-default-tag-filter):
* lisp/cedet/semantic/symref.el (semantic-symref-result)
(semantic-symref-hit-to-tag-via-db):
* lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass):
* lisp/cedet/semantic/tag.el (semantic-tag-new-variable)
(semantic-tag-new-include, semantic-tag-new-package)
(semantic-tag-set-faux, semantic-create-tag-proxy)
(semantic-tag-function-parent)
(semantic-tag-components-with-overlays):
* lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces)
(srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict):
* lisp/cedet/srecode/dictionary.el (srecode-create-dictionary)
(srecode-dictionary-add-entries, srecode-dictionary-lookup-name)
(srecode-create-dictionaries-from-tags):
* lisp/cmuscheme.el (scheme-compile-region):
* lisp/color.el (color-lab-to-lch):
* lisp/doc-view.el (doc-view-image-width)
(doc-view-set-up-single-converter):
* lisp/dynamic-setting.el (font-setting-change-default-font)
(dynamic-setting-handle-config-changed-event):
* lisp/elec-pair.el (electric-pair-text-pairs)
(electric-pair-skip-whitespace-function)
(electric-pair-string-bound-function):
* lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance)
(avl-tree-member, avl-tree-mapcar, avl-tree-iter):
* lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree):
* lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag)
(checkdoc-spellcheck-documentation-flag, checkdoc-ispell)
(checkdoc-ispell-current-buffer, checkdoc-ispell-interactive)
(checkdoc-ispell-message-interactive)
(checkdoc-ispell-message-text, checkdoc-ispell-start)
(checkdoc-ispell-continue, checkdoc-ispell-comments)
(checkdoc-ispell-defun):
* lisp/emacs-lisp/cl-generic.el (cl--generic-search-method):
* lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group):
* lisp/emacs-lisp/lisp.el (forward-sexp, up-list):
* lisp/emacs-lisp/package-x.el (package--archive-contents-from-file):
* lisp/emacs-lisp/package.el (package-desc)
(package--make-autoloads-and-stuff, package-hidden-regexps):
* lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup):
* lisp/emacs-lisp/testcover.el (testcover-nohits)
(testcover-1value):
* lisp/epg.el (epg-receive-keys, epg-start-edit-key):
* lisp/erc/erc-backend.el (erc-server-processing-p)
(erc-split-line-length, erc-server-coding-system)
(erc-server-send, erc-message):
* lisp/erc/erc-button.el (erc-button-face, erc-button-alist)
(erc-browse-emacswiki):
* lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login):
* lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation):
* lisp/erc/erc-log.el (erc-current-logfile):
* lisp/erc/erc-match.el (erc-log-match-format)
(erc-text-matched-hook):
* lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug):
* lisp/erc/erc-networks.el (erc-server-alist)
(erc-networks-alist, erc-current-network):
* lisp/erc/erc-ring.el (erc-input-ring-index):
* lisp/erc/erc-speedbar.el (erc-speedbar)
(erc-speedbar-update-channel):
* lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag):
* lisp/erc/erc-track.el (erc-track-position-in-mode-line)
(erc-track-remove-from-mode-line, erc-modified-channels-update)
(erc-track-last-non-erc-buffer, erc-track-sort-by-importance)
(erc-track-get-active-buffer):
* lisp/erc/erc.el (erc-get-channel-user-list)
(erc-echo-notice-hook, erc-echo-notice-always-hook)
(erc-wash-quit-reason, erc-format-@nick):
* lisp/ffap.el (ffap-latex-mode):
* lisp/files.el (abort-if-file-too-large)
(dir-locals--get-sort-score, buffer-stale--default-function):
* lisp/filesets.el (filesets-tree-max-level, filesets-data)
(filesets-update-pre010505):
* lisp/gnus/gnus-agent.el (gnus-agent-flush-cache):
* lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol)
(gnus-button-prefer-mid-or-mail):
* lisp/gnus/gnus-cus.el (gnus-group-parameters):
* lisp/gnus/gnus-demon.el (gnus-demon-handlers)
(gnus-demon-run-callback):
* lisp/gnus/gnus-dired.el (gnus-dired-print):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer):
* lisp/gnus/gnus-range.el (gnus-range-normalize):
* lisp/gnus/gnus-spec.el (gnus-pad-form):
* lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud)
(gnus-server-opened, gnus-server-closed, gnus-server-denied)
(gnus-server-offline):
* lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir)
(gnus-refer-thread-limit-to-thread)
(gnus-summary-limit-include-thread, gnus-summary-refer-thread)
(gnus-summary-find-matching):
* lisp/gnus/gnus-util.el (gnus-rescale-image):
* lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server):
* lisp/gnus/mail-source.el (mail-source-incoming-file-prefix):
* lisp/gnus/message.el (message-cite-reply-position)
(message-cite-style-outlook, message-cite-style-thunderbird)
(message-cite-style-gmail, message--send-mail-maybe-partially):
* lisp/gnus/mm-extern.el (mm-inline-external-body):
* lisp/gnus/mm-partial.el (mm-inline-partial):
* lisp/gnus/mml-sec.el (mml-secure-message-sign)
(mml-secure-message-sign-encrypt, mml-secure-message-encrypt):
* lisp/gnus/mml2015.el (mml2015-epg-key-image)
(mml2015-epg-key-image-to-string):
* lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail):
* lisp/gnus/nnheader.el (nnheader-directory-files-is-safe):
* lisp/gnus/nnir.el (nnir-search-history)
(nnir-imap-search-other, nnir-artlist-length)
(nnir-artlist-article, nnir-artitem-group, nnir-artitem-number)
(nnir-artitem-rsv, nnir-article-group, nnir-article-number)
(nnir-article-rsv, nnir-article-ids, nnir-categorize)
(nnir-retrieve-headers-override-function)
(nnir-imap-default-search-key, nnir-hyrex-additional-switches)
(gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms)
(nnir-read-parm, nnir-read-server-parm, nnir-search-thread):
* lisp/gnus/nnmairix.el (nnmairix-default-group)
(nnmairix-propagate-marks):
* lisp/gnus/smime.el (smime-keys, smime-crl-check)
(smime-verify-buffer, smime-noverify-buffer):
* lisp/gnus/spam-report.el (spam-report-url-ping-mm-url):
* lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header)
(spam-spamassassin-spam-status-header, spam-sa-learn-rebuild)
(spam-classifications, spam-check-stat, spam-spamassassin-score):
* lisp/help.el (describe-minor-mode-from-symbol):
* lisp/hippie-exp.el (hippie-expand-ignore-buffers):
* lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face)
(hfy-begin-span):
* lisp/ibuf-ext.el (ibuffer-update-saved-filters-format)
(ibuffer-saved-filters, ibuffer-old-saved-filters-warning)
(ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters)
(eval, ibuffer-unary-operand, file-extension, directory):
* lisp/image-dired.el (image-dired-cmd-pngcrush-options):
* lisp/image-mode.el (image-toggle-display):
* lisp/international/ccl.el (ccl-compile-read-multibyte-character)
(ccl-compile-write-multibyte-character):
* lisp/international/kkc.el (kkc-save-init-file):
* lisp/international/latin1-disp.el (latin1-display):
* lisp/international/ogonek.el (ogonek-name-encoding-alist)
(ogonek-information, ogonek-lookup-encoding)
(ogonek-deprefixify-region):
* lisp/isearch.el (isearch-filter-predicate)
(isearch--momentary-message):
* lisp/jsonrpc.el (jsonrpc-connection-send)
(jsonrpc-process-connection, jsonrpc-shutdown)
(jsonrpc--async-request-1):
* lisp/language/tibet-util.el (tibetan-char-p):
* lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date)
(feedmail-last-chance-hook, feedmail-before-fcc-hook)
(feedmail-send-it-immediately-wrapper, feedmail-find-eoh):
* lisp/mail/hashcash.el (hashcash-generate-payment)
(hashcash-generate-payment-async, hashcash-insert-payment)
(hashcash-verify-payment):
* lisp/mail/rmail.el (rmail-movemail-variant-in-use)
(rmail-get-attr-value):
* lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime):
* lisp/mail/rmailsum.el (rmail-summary-show-message):
* lisp/mail/supercite.el (sc-raw-mode-toggle):
* lisp/man.el (Man-start-calling):
* lisp/mh-e/mh-acros.el (mh-do-at-event-location)
(mh-iterate-on-messages-in-region, mh-iterate-on-range):
* lisp/mh-e/mh-alias.el (mh-alias-system-aliases)
(mh-alias-reload, mh-alias-ali)
(mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file)
(mh-alias-add-alias):
* lisp/mouse.el (mouse-save-then-kill):
* lisp/net/browse-url.el (browse-url-default-macosx-browser):
* lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value)
(eudc-variable-server-value, eudc-update-variable)
(eudc-expand-inline):
* lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result):
* lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list):
* lisp/net/pop3.el (pop3-list):
* lisp/net/soap-client.el (soap-namespace-put)
(soap-xs-parse-sequence, soap-parse-envelope):
* lisp/net/soap-inspect.el (soap-inspect-xs-complex-type):
* lisp/nxml/rng-xsd.el (rng-xsd-date-to-days):
* lisp/org/ob-C.el (org-babel-prep-session:C)
(org-babel-load-session:C):
* lisp/org/ob-J.el (org-babel-execute:J):
* lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote):
* lisp/org/ob-awk.el (org-babel-execute:awk):
* lisp/org/ob-core.el (org-babel-process-file-name):
* lisp/org/ob-ebnf.el (org-babel-execute:ebnf):
* lisp/org/ob-forth.el (org-babel-execute:forth):
* lisp/org/ob-fortran.el (org-babel-execute:fortran)
(org-babel-prep-session:fortran, org-babel-load-session:fortran):
* lisp/org/ob-groovy.el (org-babel-execute:groovy):
* lisp/org/ob-io.el (org-babel-execute:io):
* lisp/org/ob-js.el (org-babel-execute:js):
* lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond)
(org-babel-lilypond-compile-post-tangle)
(org-babel-lilypond-display-pdf-post-tangle)
(org-babel-lilypond-tangle)
(org-babel-lilypond-execute-tangled-ly)
(org-babel-lilypond-compile-lilyfile)
(org-babel-lilypond-check-for-compile-error)
(org-babel-lilypond-process-compile-error)
(org-babel-lilypond-mark-error-line)
(org-babel-lilypond-parse-error-line)
(org-babel-lilypond-attempt-to-open-pdf)
(org-babel-lilypond-attempt-to-play-midi)
(org-babel-lilypond-switch-extension)
(org-babel-lilypond-set-header-args):
* lisp/org/ob-lua.el (org-babel-prep-session:lua):
* lisp/org/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/org/ob-processing.el (org-babel-prep-session:processing):
* lisp/org/ob-python.el (org-babel-prep-session:python):
* lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message)
(org-babel-scheme-execute-with-geiser, org-babel-execute:scheme):
* lisp/org/ob-shen.el (org-babel-execute:shen):
* lisp/org/org-agenda.el (org-agenda-entry-types)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-time-grid, org-agenda-sorting-strategy)
(org-agenda-filter-by-category, org-agenda-forward-block):
* lisp/org/org-colview.el (org-columns--overlay-text):
* lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces):
* lisp/org/org-indent.el (org-indent-set-line-properties):
* lisp/org/org-macs.el (org-get-limited-outline-regexp):
* lisp/org/org-mobile.el (org-mobile-files):
* lisp/org/org.el (org-use-fast-todo-selection)
(org-extend-today-until, org-use-property-inheritance)
(org-refresh-effort-properties, org-open-at-point-global)
(org-track-ordered-property-with-tag, org-shiftright):
* lisp/org/ox-html.el (org-html-checkbox-type):
* lisp/org/ox-man.el (org-man-source-highlight)
(org-man-verse-block):
* lisp/org/ox-publish.el (org-publish-sitemap-default):
* lisp/outline.el (outline-head-from-level):
* lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-calc-command-indent, dcl-indent-to):
* lisp/progmodes/flymake.el (flymake-make-diagnostic)
(flymake--overlays, flymake-diagnostic-functions)
(flymake-diagnostic-types-alist, flymake--backend-state)
(flymake-is-running, flymake--collect, flymake-mode):
* lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop)
(gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer):
* lisp/progmodes/grep.el (grep-error-screen-columns):
* lisp/progmodes/gud.el (gud-prev-expr):
* lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column)
(ps-run-goto-error):
* lisp/progmodes/python.el (python-eldoc-get-doc)
(python-eldoc-function-timeout-permanent, python-eldoc-function):
* lisp/shadowfile.el (shadow-make-group):
* lisp/speedbar.el (speedbar-obj-do-check):
* lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook):
* lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib):
* lisp/textmodes/reftex-index.el (reftex-index-goto-entry)
(reftex-index-kill, reftex-index-undo):
* lisp/textmodes/reftex-parse.el (reftex-context-substring):
* lisp/textmodes/reftex.el (reftex-TeX-master-file):
* lisp/textmodes/rst.el (rst-next-hdr, rst-toc)
(rst-uncomment-region, rst-font-lock-extend-region-internal):
* lisp/thumbs.el (thumbs-mode):
* lisp/vc/ediff-util.el (ediff-restore-diff):
* lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag):
* lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p):
* lisp/wid-edit.el (widget-field-value-set, string):
* lisp/x-dnd.el (x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
|
|
|
"Prepare for coverage tests."
|
2002-09-28 18:45:56 +00:00
|
|
|
;;Clean up from any previous runs
|
|
|
|
(condition-case nil (kill-buffer "ses-example.ses") (error nil))
|
|
|
|
(condition-case nil (kill-buffer "ses-test.ses") (error nil))
|
|
|
|
(condition-case nil (delete-file "ses-test.ses") (file-error nil))
|
|
|
|
(delete-other-windows) ;Needed for "\C-xo" in ses-exercise-editing
|
|
|
|
(setq ses-mode-map nil) ;Force rebuild
|
|
|
|
(testcover-unmark-all "ses.el")
|
|
|
|
;;Enable
|
|
|
|
(let ((testcover-1value-functions
|
|
|
|
;;forward-line always returns 0, for us.
|
|
|
|
;;remove-text-properties always returns t for us.
|
|
|
|
;;ses-recalculate-cell returns the same " " any time curcell is a cons
|
|
|
|
;;Macros ses-dorange and ses-dotimes-msg generate code that always
|
|
|
|
;; returns nil
|
|
|
|
(append '(forward-line remove-text-properties ses-recalculate-cell
|
|
|
|
ses-dorange ses-dotimes-msg)
|
|
|
|
testcover-1value-functions))
|
|
|
|
(testcover-constants
|
|
|
|
;;These maps get initialized, then never changed again
|
|
|
|
(append '(ses-mode-map ses-mode-print-map ses-mode-edit-map)
|
|
|
|
testcover-constants)))
|
|
|
|
(testcover-start "ses.el" t))
|
|
|
|
(require 'unsafep)) ;In case user has safe-functions = t!
|
|
|
|
|
|
|
|
|
|
|
|
;;;#########################################################################
|
|
|
|
(defun ses-exercise ()
|
|
|
|
"Executes all SES coverage tests and displays the results."
|
|
|
|
(interactive)
|
|
|
|
(ses-exercise-startup)
|
|
|
|
;;Run the keyboard-macro tests
|
|
|
|
(let ((safe-functions nil)
|
|
|
|
(ses-initial-size '(1 . 1))
|
|
|
|
(ses-initial-column-width 7)
|
|
|
|
(ses-initial-default-printer "%.7g")
|
|
|
|
(ses-after-entry-functions '(forward-char))
|
|
|
|
(ses-mode-hook nil))
|
|
|
|
(ses-exercise-macros)
|
|
|
|
(ses-exercise-signals)
|
|
|
|
(ses-exercise-invalid-spreadsheets)
|
|
|
|
;;Upgrade of old-style spreadsheet
|
|
|
|
(with-temp-buffer
|
2018-03-29 17:41:11 -07:00
|
|
|
(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")
|
2002-09-28 18:45:56 +00:00
|
|
|
(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.
|
|
|
|
(let ((x [1 2 3]))
|
|
|
|
(ses-vector-delete 'x 0 0))
|
|
|
|
;;ses-create-header-string behaves differently in a non-window environment
|
|
|
|
;;but we always test under windows.
|
|
|
|
(let ((window-system (not window-system)))
|
|
|
|
(scroll-left 7)
|
|
|
|
(ses-create-header-string))
|
|
|
|
;;Test for nonstandard after-entry functions
|
|
|
|
(let ((ses-after-entry-functions '(forward-line))
|
|
|
|
ses-mode-hook)
|
|
|
|
(ses-read-cell 0 0 1)
|
|
|
|
(ses-read-symbol 0 0 t)))
|
|
|
|
;;Tests with unsafep disabled
|
|
|
|
(let ((safe-functions t)
|
|
|
|
ses-mode-hook)
|
|
|
|
(message "<Checking safe-functions = t>")
|
|
|
|
(kill-buffer "ses-example.ses")
|
|
|
|
(find-file "ses-example.ses"))
|
|
|
|
;;Checks for nonstandard default values for new spreadsheets
|
|
|
|
(let (ses-mode-hook)
|
|
|
|
(dolist (x '(("%.6g" 8 (2 . 2))
|
|
|
|
("%.8g" 6 (3 . 3))))
|
|
|
|
(let ((ses-initial-size (nth 2 x))
|
|
|
|
(ses-initial-column-width (nth 1 x))
|
|
|
|
(ses-initial-default-printer (nth 0 x)))
|
|
|
|
(with-temp-buffer
|
|
|
|
(set-buffer-modified-p t)
|
|
|
|
(ses-mode)))))
|
|
|
|
;;Test error-handling in command hook, outside a macro.
|
|
|
|
;;This will ring the bell.
|
|
|
|
(let (curcell-overlay)
|
|
|
|
(ses-command-hook))
|
|
|
|
;;Due to use of run-with-timer, ses-command-hook sometimes gets called
|
|
|
|
;;after we switch to another buffer.
|
|
|
|
(switch-to-buffer "*scratch*")
|
|
|
|
(ses-command-hook)
|
|
|
|
;;Print results
|
|
|
|
(message "<Marking source code>")
|
|
|
|
(testcover-mark-all "ses.el")
|
|
|
|
(testcover-next-mark)
|
|
|
|
;;Cleanup
|
|
|
|
(delete-other-windows)
|
|
|
|
(kill-buffer "ses-test.txt")
|
|
|
|
;;Could do this here: (testcover-end "ses.el")
|
|
|
|
(message "Done"))
|
|
|
|
|
|
|
|
;; testcover-ses.el ends here.
|