;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\312\313\314\315\316\317\320& \210\321\322\323\324\325DD\326\311\304\327\330&\210\321\331\323\324\332DD\333\311\304\327\334&\210\321\335\323\324\336DD\337\311\304\327\340&\210\321\341\323\324\342DD\343\311\304\327\344\345\346& \210\321\347\323\324\350DD\351\311\304\327\344&\207" [require unsafep macroexp custom-declare-group ses nil "Simple Emacs Spreadsheet." :tag "SES" :group applications :link (custom-manual "(ses) Top") :prefix "ses-" :version "21.1" custom-declare-variable ses-initial-size funcall function #[0 "\300\207" [(1 . 1)] 1] "Initial size of a new spreadsheet, as a cons (NUMROWS . NUMCOLS)." :type (cons (integer :tag "numrows") (integer :tag "numcols")) ses-initial-column-width #[0 "\300\207" [7] 1] "Initial width of columns in a new spreadsheet." (integer :match (lambda (widget value) (> value 0))) ses-initial-default-printer #[0 "\300\207" [#1="%.7g"] 1 #1#] "Initial default printer for a new spreadsheet." (choice string (list :tag "Parenthesized string" string) function) ses-after-entry-functions #[0 "\300\207" [(forward-char)] 1] "Things to do after entering a value into a cell.\nAn abnormal hook that usually runs a cursor-movement function.\nEach function is called with ARG=1." hook :options (forward-char backward-char next-line previous-line) ses-mode-hook #[0 "\300\207" [nil] 1] "Hook functions to be run upon entering SES mode."] 14) #@43 List of formulas that have been typed in. (defvar ses-read-cell-history nil (#$ . 1855)) #@52 List of printer functions that have been typed in. (defvar ses-read-printer-history nil (#$ . 1950)) #@72 Context menu when mouse-3 is used on the header-line in an SES buffer. (defvar ses-header-line-menu nil (#$ . 2057)) (easy-menu-do-define 'ses-header-line-menu nil "Context menu when mouse-3 is used on the header-line in an SES buffer." '("SES header row" ["Set current row" ses-set-header-row t] ["Unset row" ses-unset-header-row (> ses--header-row 0)])) #@44 Local keymap for Simple Emacs Spreadsheet. (defconst ses-mode-map (byte-code "\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\324\326\327BBBBBBBBBBBBBBBBBBBBBBBB\330 \203H\331@A@#\210AA\262\2023\207" [ses-header-line-menu "\214" ses-reconstruct-all "\f" ses-recalculate-all "" ses-renarrow-buffer "" ses-recalculate-cell "\223" ses-sort-column "\210" ses-set-header-row "" ses-truncate-cell "\n" ses-jump "" ses-read-default-printer "\214" ses-reprint-all [33554444] [header-line down-mouse-3] ([header-line mouse-2] ses-sort-column-click) make-sparse-keymap define-key] 25) (#$ . 2419)) #@24 Menu bar menu for SES. (defvar ses-menu nil (#$ . 3072)) (easy-menu-do-define 'ses-menu ses-mode-map "Menu bar menu for SES." '("SES" ["Insert row" ses-insert-row (ses-in-print-area)] ["Delete row" ses-delete-row (ses-in-print-area)] ["Insert column" ses-insert-column (ses-in-print-area)] ["Delete column" ses-delete-column (ses-in-print-area)] ["Set column printer" ses-read-column-printer t] ["Set column width" ses-set-column-width t] ["Set default printer" ses-read-default-printer t] ["Jump to cell" ses-jump t] ["Set cell printer" ses-read-cell-printer t] ["Recalculate cell" ses-recalculate-cell t] ["Truncate cell display" ses-truncate-cell t] ["Export values" ses-export-tsv t] ["Export formulas" ses-export-tsf t])) #@62 List for keys that can be used for completion while editing. (defconst ses-completion-keys '("\211" " ") (#$ . 3805)) #@261 Set globally to what completion table to use depending on type of completion (local printers, cells, etc.). We need to go through a local variable to pass the SES buffer local variable to completing function while the current buffer is the minibuffer. (defvar ses--completion-table nil (#$ . 3930)) #@90 Calling buffer for SES listing help. Used for listing local printers or renamed cells. (defvar ses--list-orig-buffer nil (#$ . 4243)) #@47 Local keymap for SES minibuffer cell-editing. (defconst ses-mode-edit-map (byte-code "\301\302 \303\"\210\203\304\211A\262\242\211A\262\242#\210\202\207" [minibuffer-local-map ("" ses-insert-range "" ses-insert-ses-range [S-mouse-3] ses-insert-range-click [C-S-mouse-3] ses-insert-ses-range-click "" ses-list-local-printers "" ses-list-named-cells "\211" lisp-complete-symbol) make-sparse-keymap set-keymap-parent define-key] 7) (#$ . 4385)) (byte-code "\300\301\302\303\304\305 \306\307\"\210G\310\211W\203*\211\311\312\211T#\313#\266\211T\262\202\266\203C\314@A@\315 $\210AA\262\202,\311\316\317#\210\203_\311@A@#\210AA\262\202I\266\203\"\207" [defalias ses-mode-print-map ([backtab] backward-char [tab] ses-forward-or-insert " " ses-forward-or-insert "\357" ses-insert-column "" ses-insert-row " " ses-edit-cell "\353" ses-delete-column "\371" ses-yank-pop " " ses-delete-row "\n" ses-append-row-jump-first-column "\350" ses-mark-row "\310" ses-mark-column "" ses-clear-cell-forward "" ses-clear-cell-backward "(" ses-read-cell "\"" ses-read-cell "'" ses-read-symbol "=" ses-edit-cell "c" ses-recalculate-cell "j" ses-jump "p" ses-read-cell-printer "t" ses-truncate-cell "w" ses-set-column-width "x" ses-export-keymap "\360" ses-read-column-printer) (clipboard-kill-region ses-kill-override end-of-line ses-end-of-line kill-line ses-delete-row kill-region ses-kill-override open-line ses-insert-row) "0123456789.-" make-keymap suppress-keymap t 0 define-key substring ses-read-cell substitute-key-definition current-global-map [(menu-bar) edit cut] ses-kill-override] 15) (defconst ses-mode-print-map (symbol-function 'ses-mode-print-map)) (byte-code "\300\301\302\303!\304\305\306\307B#\210\304\310\311\312B#\210\211\262\"\207" [defalias ses-export-keymap make-sparse-keymap "SES export" define-key "T" " tab-formulas" ses-export-tsf "t" " tab-values" ses-export-tsv] 8) #@71 Marker string denoting the boundary between print area and data area. (defconst ses-print-data-boundary "\n\f\n" (#$ . 6323)) #@77 Initial contents for the three-element list at the bottom of the data area. (defconst ses-initial-global-parameters "\n( ;Global parameters (these are read first)\n 2 ;SES file-format\n 1 ;numrows\n 1 ;numcols\n)\n\n" (#$ . 6455)) #@31 Match Global parameters for . (defconst ses-initial-global-parameters-re "\n( ;Global parameters (these are read first)\n [23] ;SES file-format\n [0-9]+ ;numrows\n [0-9]+ ;numcols\n\\( [0-9]+ ;numlocprn\n\\)?)\n\n" (#$ . 6692)) #@71 Initial contents for the file-trailer area at the bottom of the file. (defconst ses-initial-file-trailer ";; Local Variables:\n;; mode: ses\n;; End:\n" (#$ . 6926)) #@47 The initial contents of an empty spreadsheet. (defconst ses-initial-file-contents (concat " \n" ses-print-data-boundary "(ses-cell A1 nil nil nil nil)\n\n(ses-column-widths [7])\n(ses-column-printers [nil])\n(ses-default-printer \"%.7g\")\n(ses-header-row 0)\n" ses-initial-global-parameters ses-initial-file-trailer) (#$ . 7097)) #@73 Display properties to create a raised box for cells in the header line. (defconst ses-box-prop '(:box (:line-width 2 :style released-button)) (#$ . 7440)) #@299 List of print functions to be included in initial history of printer functions. None of these standard-printer functions, except function `ses-prin1', is suitable for use as a column printer or a global-default printer because they invoke the column or default printer and then modify its output. (defconst ses-standard-printer-functions '(ses-center ses-center-span ses-dashfill ses-dashfill-span ses-tildefill-span ses-prin1) (#$ . 7602)) #@37 Buffer-local variables used by SES. (defconst ses-localvars '(ses--blank-line ses--cells ses--col-printers ses--col-widths ses--curcell ses--curcell-overlay ses--default-printer (ses--local-printer-hashmap . :hashmap) (ses--numlocprn . 0) ses--deferred-narrow ses--deferred-recalc ses--deferred-write ses--file-format ses--named-cell-hashmap (ses--header-hscroll . -1) ses--header-row ses--header-string ses--linewidth ses--numcols ses--numrows ses--symbolic-formulas ses--data-marker ses--params-marker (ses--Dijkstra-attempt-nb . 0) ses--Dijkstra-weight-bound ses--in-killing-named-cell-list next-line-add-newlines transient-mark-mode) (#$ . 8050)) #@12 (fn EXP) (defalias 'ses--metaprogramming '(macro . #[257 "\300\301\"\207" [eval t] 4 (#$ . 8707)])) (put 'ses--metaprogramming 'edebug-form-spec t) #@53 Set buffer-local and initialize some SES variables. (defalias 'ses-set-localvars #[0 "\211\205V\211@\2119\203\301!\302L\210\202O\211:\203J\211A\250\203+\301@!AL\210\202O\211A\303=\203?\301@!\304\305\306\"L\210\202O\307\310A@#\210\202O\307\311\"\210A\266\202\202\207" [ses-localvars make-local-variable nil :hashmap make-hash-table :test eq error "Unexpected initializer `%S' in list `ses-localvars' for entry %S" "Unexpected elements `%S' in list `ses-localvars'"] 6 (#$ . 8864)]) (put 'ses--symbolic-formulas 'safe-local-variable 'consp) #@101 Offsets from "Global parameters" line to various parameter lines in the data area of a spreadsheet. (defconst ses-paramlines-plist '(ses--col-widths -5 ses--col-printers -4 ses--default-printer -3 ses--header-row -2 ses--file-format 1 ses--numrows 2 ses--numcols 3 ses--numlocprn 4) (#$ . 9431)) #@86 Formats of "Global parameters" various parameters in the data area of a spreadsheet. (defconst ses-paramfmt-plist '(ses--col-widths "(ses-column-widths %S)" ses--col-printers "(ses-column-printers %S)" ses--default-printer "(ses-default-printer %S)" ses--header-row "(ses-header-row %S)" ses--file-format " %S ;SES file-format" ses--numrows " %S ;numrows" ses--numcols " %S ;numcols" ses--numlocprn " %S ;numlocprn") (#$ . 9733)) #@320 Set by `ses-relocate-formula' and `ses-relocate-range', read by `ses-relocate-all'. Set to `delete' if a cell-reference was deleted from a formula--so the formula needs recalculation. Set to `range' if the size of a `ses-range' was changed--so both the formula's value and list of dependents need to be recalculated. (defvar ses-relocate-return nil (#$ . 10170)) #@202 Set to t if last cell printer invoked by `ses-call-printer' requested left-justification of the result. Set to error-signal if `ses-call-printer' encountered an error during printing. Otherwise nil. (defvar ses-call-printer-return nil (#$ . 10542)) #@107 Time when current operation started. Used by `ses-time-check' to decide when to emit a progress message. (defvar ses-start-time nil (#$ . 10800)) #@87 Return the cell structure that stores information about cell (ROW,COL). (fn ROW COL) (defalias 'ses-get-cell '(macro . #[514 "\300\211\301EE\207" [aref ses--cells] 6 (#$ . 10953)])) (put 'ses-get-cell 'edebug-form-spec t) #@73 compiler-macro for inlining `ses-cell--symbol'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses-cell--symbol--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses-cell--symbol (progn (aref cl-x 0))) nil] 9 (#$ . 11184)]) (put 'ses-cell--symbol 'compiler-macro 'ses-cell--symbol--cmacro) #@60 Access slot "symbol" of `ses-cell' struct CL-X. (fn CL-X) (defalias 'ses-cell--symbol #[257 "\211\300H\207" [0] 3 (#$ . 11505)]) (byte-code "\300\301\302\303#\300\207" [function-put ses-cell--symbol side-effect-free t] 4) #@74 compiler-macro for inlining `ses-cell--formula'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses-cell--formula--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses-cell--formula (progn (aref cl-x 1))) nil] 9 (#$ . 11734)]) (put 'ses-cell--formula 'compiler-macro 'ses-cell--formula--cmacro) #@61 Access slot "formula" of `ses-cell' struct CL-X. (fn CL-X) (defalias 'ses-cell--formula #[257 "\211\300H\207" [1] 3 (#$ . 12060)]) (byte-code "\300\301\302\303#\300\207" [function-put ses-cell--formula side-effect-free t] 4) #@74 compiler-macro for inlining `ses-cell--printer'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses-cell--printer--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses-cell--printer (progn (aref cl-x 2))) nil] 9 (#$ . 12292)]) (put 'ses-cell--printer 'compiler-macro 'ses-cell--printer--cmacro) #@61 Access slot "printer" of `ses-cell' struct CL-X. (fn CL-X) (defalias 'ses-cell--printer #[257 "\211\300H\207" [2] 3 (#$ . 12618)]) (byte-code "\300\301\302\303#\300\207" [function-put ses-cell--printer side-effect-free t] 4) #@77 compiler-macro for inlining `ses-cell--references'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses-cell--references--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses-cell--references (progn (aref cl-x 3))) nil] 9 (#$ . 12850)]) (put 'ses-cell--references 'compiler-macro 'ses-cell--references--cmacro) #@64 Access slot "references" of `ses-cell' struct CL-X. (fn CL-X) (defalias 'ses-cell--references #[257 "\211\300H\207" [3] 3 (#$ . 13191)]) (byte-code "\300\301\302\303#\300\207" [function-put ses-cell--references side-effect-free t] 4) #@77 compiler-macro for inlining `ses-cell--properties'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses-cell--properties--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses-cell--properties (progn (aref cl-x 4))) nil] 9 (#$ . 13432)]) (put 'ses-cell--properties 'compiler-macro 'ses-cell--properties--cmacro) #@64 Access slot "properties" of `ses-cell' struct CL-X. (fn CL-X) (defalias 'ses-cell--properties #[257 "\211\300H\207" [4] 3 (#$ . 13773)]) (byte-code "\300\301\302\303#\300\207" [function-put ses-cell--properties side-effect-free t] 4) #@109 compiler-macro for inlining `ses-make-cell'. (fn CL-WHOLE-ARG &optional SYMBOL FORMULA PRINTER REFERENCES) (defalias 'ses-make-cell--cmacro #[1281 "\300\301\302\303\211\211    & \207" [cl--defsubst-expand (symbol formula printer references) (cl-block ses-make-cell (vector symbol formula printer references nil)) nil] 15 (#$ . 14015)]) (put 'ses-make-cell 'compiler-macro 'ses-make-cell--cmacro) #@95 Constructor for objects of type `ses-cell'. (fn &optional SYMBOL FORMULA PRINTER REFERENCES) (defalias 'ses-make-cell #[1024 "\300\301%\207" [vector nil] 10 (#$ . 14422)]) (byte-code "\300\301\302\303#\304\305\306\211\307\306\310\311\305\306& \207" [function-put ses-make-cell side-effect-free t cl-struct-define ses-cell nil vector ((symbol) (formula) (printer) (references) (properties)) cl-struct-ses-cell-tags] 11) #@70 compiler-macro for inlining `ses--locprn-p'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses--locprn-p--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses--locprn-p (and (memq (type-of cl-x) cl-struct-ses--locprn-tags) t)) nil] 9 (#$ . 14852)]) (put 'ses--locprn-p 'compiler-macro 'ses--locprn-p--cmacro) #@13 (fn CL-X) (defalias 'ses--locprn-p #[257 "\301!>\205 \302\207" [cl-struct-ses--locprn-tags type-of t] 3 (#$ . 15193)]) (byte-code "\300\301\302\303#\304\305\306\301#\207" [function-put ses--locprn-p side-effect-free error-free put ses--locprn cl-deftype-satisfies] 5) #@72 compiler-macro for inlining `ses--locprn-def'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses--locprn-def--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses--locprn-def (progn (or (ses--locprn-p cl-x) (signal 'wrong-type-argument (list 'ses--locprn cl-x))) (aref cl-x 1))) nil] 9 (#$ . 15472)]) (put 'ses--locprn-def 'compiler-macro 'ses--locprn-def--cmacro) #@60 Access slot "def" of `ses--locprn' struct CL-X. (fn CL-X) (defalias 'ses--locprn-def #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-ses--locprn-tags type-of signal wrong-type-argument ses--locprn 1] 5 (#$ . 15869)]) (byte-code "\300\301\302\303#\300\207" [function-put ses--locprn-def side-effect-free t] 4) #@77 compiler-macro for inlining `ses--locprn-compiled'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses--locprn-compiled--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses--locprn-compiled (progn (or (ses--locprn-p cl-x) (signal 'wrong-type-argument (list 'ses--locprn cl-x))) (aref cl-x 2))) nil] 9 (#$ . 16204)]) (put 'ses--locprn-compiled 'compiler-macro 'ses--locprn-compiled--cmacro) #@65 Access slot "compiled" of `ses--locprn' struct CL-X. (fn CL-X) (defalias 'ses--locprn-compiled #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-ses--locprn-tags type-of signal wrong-type-argument ses--locprn 2] 5 (#$ . 16626)]) (byte-code "\300\301\302\303#\300\207" [function-put ses--locprn-compiled side-effect-free t] 4) #@75 compiler-macro for inlining `ses--locprn-number'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses--locprn-number--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses--locprn-number (progn (or (ses--locprn-p cl-x) (signal 'wrong-type-argument (list 'ses--locprn cl-x))) (aref cl-x 3))) nil] 9 (#$ . 16976)]) (put 'ses--locprn-number 'compiler-macro 'ses--locprn-number--cmacro) #@63 Access slot "number" of `ses--locprn' struct CL-X. (fn CL-X) (defalias 'ses--locprn-number #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-ses--locprn-tags type-of signal wrong-type-argument ses--locprn 3] 5 (#$ . 17388)]) (byte-code "\300\301\302\303#\300\207" [function-put ses--locprn-number side-effect-free t] 4) #@87 compiler-macro for inlining `ses--locprn-local-printer-list'. (fn CL-WHOLE-ARG CL-X) (defalias 'ses--locprn-local-printer-list--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block ses--locprn-local-printer-list (progn (or (ses--locprn-p cl-x) (signal 'wrong-type-argument (list 'ses--locprn cl-x))) (aref cl-x 4))) nil] 9 (#$ . 17732)]) (put 'ses--locprn-local-printer-list 'compiler-macro 'ses--locprn-local-printer-list--cmacro) #@75 Access slot "local-printer-list" of `ses--locprn' struct CL-X. (fn CL-X) (defalias 'ses--locprn-local-printer-list #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-ses--locprn-tags type-of signal wrong-type-argument ses--locprn 4] 5 (#$ . 18204)]) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put ses--locprn-local-printer-list side-effect-free t defalias copy-ses--locprn copy-sequence] 4) #@118 compiler-macro for inlining `make-ses--locprn'. (fn CL-WHOLE &cl-quote &key DEF COMPILED NUMBER LOCAL-PRINTER-LIST) (defalias 'make-ses--locprn--cmacro #[385 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\211\203D\211@\305>\203,\211AA\262\202\306>A@\203;\307\262\202\310\311@\"\210\202\210\312\313\314\307 \307    & \207" [plist-member :def :compiled :number :local-printer-list (:def :compiled :number :local-printer-list :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:def :compiled :number :local-printer-list)" cl--defsubst-expand (def compiled number local-printer-list) (cl-block make-ses--locprn (record 'ses--locprn def compiled number local-printer-list))] 16 (#$ . 18635)]) (put 'make-ses--locprn 'compiler-macro 'make-ses--locprn--cmacro) #@98 Constructor for objects of type `ses--locprn'. (fn &key DEF COMPILED NUMBER LOCAL-PRINTER-LIST) (defalias 'make-ses--locprn #[128 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\211\203D\211@\305>\203,\211AA\262\202\306>A@\203;\307\262\202\310\311@\"\210\202\210\312\313%\207" [plist-member :def :compiled :number :local-printer-list (:def :compiled :number :local-printer-list :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:def :compiled :number :local-printer-list)" record ses--locprn] 11 (#$ . 19452)]) (byte-code "\300\301\302\303#\300\207" [function-put make-ses--locprn side-effect-free t] 4) #@135 Constructor for objects of type `ses--locprn'. (fn DEF &optional (COMPILED (ses-local-printer-compile def)) (NUMBER ses--numlocprn)) (defalias 'ses-make-local-printer-info #[385 "\211\203 \211A\262\242\202\301!\203\211A\262\242\202\203-\302\303\304\305G\\D\"\210\306\307\310%\207" [ses--numlocprn ses-local-printer-compile signal wrong-number-of-arguments ses-make-local-printer-info 3 record ses--locprn nil] 10 (#$ . 20119)]) (byte-code "\300\301\302\303#\304\305\306\307\310\306\311\312\305\303& \207" [function-put ses-make-local-printer-info side-effect-free t cl-struct-define ses--locprn nil cl-structure-object record ((cl-tag-slot) (def) (compiled) (number) (local-printer-list)) cl-struct-ses--locprn-tags] 11) #@136 From a CELL or a pair (ROW,COL), get the symbol that names the local-variable holding its value. (0,0) => A1. (fn ROW &optional COL) (defalias 'ses-cell-symbol '(macro . #[513 "\300\203\f\301E\202 D\207" [ses-cell--symbol ses-get-cell] 6 (#$ . 20869)])) (byte-code "\300\301\302\303#\210\300\301\304\303#\207" [put ses-cell-symbol edebug-form-spec t safe-function] 4) #@100 From a CELL or a pair (ROW,COL), get the function that computes its value. (fn ROW &optional COL) (defalias 'ses-cell-formula '(macro . #[513 "\300\203\f\301E\202 D\207" [ses-cell--formula ses-get-cell] 6 (#$ . 21252)])) (put 'ses-cell-formula 'edebug-form-spec t) #@98 From a CELL or a pair (ROW,COL), get the function that prints its value. (fn ROW &optional COL) (defalias 'ses-cell-printer '(macro . #[513 "\300\203\f\301E\202 D\207" [ses-cell--printer ses-get-cell] 6 (#$ . 21530)])) (put 'ses-cell-printer 'edebug-form-spec t) #@128 From a CELL or a pair (ROW,COL), get the list of symbols for cells whose functions refer to its value. (fn ROW &optional COL) (defalias 'ses-cell-references '(macro . #[513 "\300\203\f\301E\202 D\207" [ses-cell--references ses-get-cell] 6 (#$ . 21807)])) (put 'ses-cell-references 'edebug-form-spec t) #@135 From a cell-symbol SYM, gets the cons (row . col). A1 => (0 . 0). Result is nil if SYM is not a symbol that names a cell. (fn SYM) (defalias 'ses-sym-rowcol '(macro . #[257 "\300\301\302\303D\304\305BBEDC\306\307\302\310\311\312BBE\313BBBE\207" [let rc and symbolp get ('ses-cell) if (eq rc :ses-named) ses--named-cell-hashmap gethash (ses--named-cell-hashmap) (rc)] 10 (#$ . 22123)])) (put 'ses-sym-rowcol 'edebug-form-spec t) #@64 Return non-nil if CELL is a cell of current buffer. (fn CELL) (defalias 'ses-cell-p #[257 "\302!\205?\211G\303U\205?\211\304H9\205\304H\305N\211\306=\203-\205.\307\304H\"\202.\211\262\211:\205< @HAH\262=\207" [ses--named-cell-hashmap ses--cells vectorp 5 0 ses-cell :ses-named gethash] 6 (#$ . 22564)]) #@110 Return PLIST after deleting the first pair (if any) with symbol PROP. This can alter PLIST. (fn PLIST PROP) (defalias 'ses-plist-delq #[514 "\204\300\207@=\203AA\207A\211A\301\"\241\210\207" [nil ses-plist-delq] 8 (#$ . 22893)]) #@49 A list of buffers containing a SES spreadsheet. (defvar ses--ses-buffer-list nil (#$ . 23142)) #@54 Make NAME non longer a renamed cell name. (fn NAME) (defalias 'ses--unbind-cell-name #[257 "\302\"\210\303!\210\304 \304\203A\211A\262\242\262\211p=\204\f\305!\204,\306 \"\202\fr\211q\210\307\"\203=\310\262\304\262)\202\f?\205P\311\312\313!\314\"\"\207" [ses--named-cell-hashmap ses--ses-buffer-list remhash kill-local-variable nil buffer-live-p delq gethash t setplist ses-plist-delq symbol-plist ses-cell] 9 (#$ . 23243)]) #@30 (fn VARS PLACE &rest BODY) (defalias 'ses--letref '(macro . #[642 "\300\301\302\303\304\305 \"\306\"\307\310%\"\207" [gv-get make-byte-code 514 "\302\300@\303\304DE\300A@\305\306\304D\307BBED\301BB\207" vconcat vector [cl-macrolet nil quote (v) funcall (v)] 9 "\n\n(fn GETTER SETTER)"] 12 (#$ . 23700)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put ses--letref lisp-indent-function 2 put edebug-form-spec (sexp form body)] 5) #@240 Get property named PROPERTY-NAME from a CELL or a pair (ROW,COL). When COL is omitted, CELL=ROW is a cell object. When COL is present ROW and COL are the integer coordinates of the cell of interest. (fn PROPERTY-NAME ROW &optional COL) (defalias 'ses-cell-property '(macro . #[770 "\300\301\203\302E\202DE\207" [alist-get ses-cell--properties ses-get-cell] 9 (#$ . 24164)])) (put 'ses-cell-property 'edebug-form-spec t) #@157 From a CELL or a pair (ROW,COL), get and remove the property value of the corresponding cell with name PROPERTY-NAME. (fn PROPERTY-NAME ROW &optional COL) (defalias 'ses-cell-property-pop '(macro . #[770 "\300\301\302\303\203\304E\202D\305BBB\306BBB\207" [ses--letref (pget pset) alist-get ses-cell--properties ses-get-cell (nil t) ((prog1 (pget) (pset nil)))] 11 (#$ . 24603)])) #@95 From a CELL or a pair (ROW,COL), get the current value for that cell. (fn ROW &optional COL) (defalias 'ses-cell-value '(macro . #[513 "\300\301ED\207" [symbol-value ses-cell-symbol] 6 (#$ . 25002)])) (put 'ses-cell-value 'edebug-form-spec t) #@44 Return the width for column COL. (fn COL) (defalias 'ses-col-width '(macro . #[257 "\300\301E\207" [aref ses--col-widths] 4 (#$ . 25254)])) (put 'ses-col-width 'edebug-form-spec t) #@54 Return the default printer for column COL. (fn COL) (defalias 'ses-col-printer '(macro . #[257 "\300\301E\207" [aref ses--col-printers] 4 (#$ . 25443)])) (put 'ses-col-printer 'edebug-form-spec t) #@67 Check whether SYM point at a cell of this spread sheet. (fn SYM) (defalias 'ses-is-cell-sym-p #[257 "\211\304N\211\2054\211\305=\203\2054\306\"\2024\211@ W\2054\211A\nW\2054 @HAH\211\307H\262=\207" [ses--named-cell-hashmap ses--numrows ses--numcols ses--cells ses-cell :ses-named gethash 0] 5 (#$ . 25648)]) #@256 Load a cell SYM from the spreadsheet file. Does not recompute VALUE from FORMULA, does not reprint using PRINTER, does not check REFERENCES. Safety-checking for FORMULA and PRINTER are deferred until first use. (fn SYM VALUE FORMULA PRINTER REFERENCES) (defalias 'ses--cell #[1285 "9\205\303N\211\304=\203\205\305\"\202\211\262\306!\210\307!\210\2044\310=\2044\311!\262:\203D \312=\204D\313D\262\203X;\204X \312=\204X\314D\262\n@HA\315\n   \316%I\266L\207" [ses--named-cell-hashmap safe-functions ses--cells ses-cell :ses-named gethash ses-formula-record ses-printer-record *skip* macroexp-quote t ses-safe-formula ses-safe-printer vector nil] 16 (#$ . 25978)]) #@78 Convert local printer function into faster printer definition. (fn PRINTER) (defalias 'ses-local-printer-compile #[257 "\300!\203\207\211;\203\301\302\303\304\305\306\307BBFE\207\211\242;\2031\301\310\303\311\305\312\306@\313BB\257E\207\314\315\"\207" [functionp lambda (x) if (null x) "" format (x) (x) (null x) (setq ses-call-printer-return t) (x) error "Invalid printer %S"] 10 (#$ . 26694)]) #@99 Define a local printer with name NAME and definition DEF. Return the printer info. (fn NAME DEF) (defalias 'ses--local-printer #[514 "9\203 \302!\204\303\304!\210\305\"\203\303\306\"\210\307!\211 \235\203) \210\202-\211 B\210\310\311\312!!#\207" [ses--local-printer-hashmap ses-read-printer-history ses-printer-validate error "Invalid local printer definition" gethash "Duplicate printer definition %S" symbol-name puthash ses-make-local-printer-info ses-safe-printer] 7 (#$ . 27109)]) #@129 Load the vector of column widths from the spreadsheet file. This is a macro to prevent propagate-on-load viruses. (fn WIDTHS) (defalias 'ses-column-widths '(macro . #[257 "\304!\203 \211GU\204\305\306!\210\211\307\310\311\312\313\"#\314\n\315\"\316P\317\207" [ses--numcols ses--col-widths ses--linewidth ses--blank-line vectorp error "Bad column-width vector" apply + -1 mapcar 1+ make-string 32 "\n" t] 7 (#$ . 27620)])) #@160 Load the vector of column printers from the spreadsheet file and checks them for safety. This is a macro to prevent propagate-on-load viruses. (fn PRINTERS) (defalias 'ses-column-printers '(macro . #[257 "\302!\203 \211GU\204\303\304!\210\305\211W\203,\211\306H!I\266\211T\262\202\266\211\307\310\"\210\311\207" [ses--numcols ses--col-printers vectorp error "Bad column-printers vector" 0 ses-safe-printer mapc ses-printer-record t] 9 (#$ . 28060)])) #@150 Load the global default printer from the spreadsheet file and checks it for safety. This is a macro to prevent propagate-on-load viruses. (fn DEF) (defalias 'ses-default-printer '(macro . #[257 "\301!\302!\210\303\207" [ses--default-printer ses-safe-printer ses-printer-record t] 3 (#$ . 28540)])) #@138 Load the header row from the spreadsheet file and checks it for safety. This is a macro to prevent propagate-on-load viruses. (fn ROW) (defalias 'ses-header-row '(macro . #[257 "\302!\203\303U\204\211W\204\304\305!\210\211\306\207" [ses--numrows ses--header-row wholenump 0 error "Bad header-row" t] 3 (#$ . 28850)])) #@223 Execute BODY repeatedly, with the variables `row' and `col' set to each cell in the range specified by CURCELL. The range is available in the variables `minrow', `maxrow', `mincol', and `maxcol'. (fn CURCELL &rest BODY) (defalias 'ses-dorange '(macro . #[385 "\300\301!\300\302!\300\303!\300\304!\300\305!\306D\307\310\311\nD\312 D FDD\307\310\311 D\313\fD\fFDDE\314\315\312DD\316\312DD\317\313\nDD\320\313\nDDF\321\322\323B\314\324\325 \326BBDC\322\n\327B\314\330\325\331BBDCBBEEEFE\207" [make-symbol "cur" "min" "max" "r" "c" let* ses-sym-rowcol if consp car cdr let minrow maxrow mincol maxcol (if (or (> minrow maxrow) (> mincol maxcol)) (error "Empty range")) dotimes ((- maxrow minrow -1)) row + (minrow) ((- maxcol mincol -1)) col (mincol)] 23 (#$ . 29187)])) (byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put ses-dorange lisp-indent-function defun put edebug-form-spec (form body)] 5) #@113 Create a new vector which is one larger than ARRAY and has NEW inserted before element IDX. (fn ARRAY IDX NEW) (defalias 'ses-vector-insert #[771 "G\300T\"\301\211W\203,\211W\203\202T HI\266\211T\262\202 \266\207" [make-vector 0] 12 (#$ . 30130)]) #@246 Create a new vector which is a copy of ARRAY with COUNT objects removed starting at element IDX. ARRAY is either a vector or a symbol whose value is a vector--if a symbol, the new vector is assigned as the symbol's value. (fn ARRAY IDX COUNT) (defalias 'ses-vector-delete #[771 "\300!\203\n\202\fJ\211GZ\301\302\"\303\211W\203;\211 W\203,\2020\n\\HI\266\211T\262\202\2669\203FL\210\207" [arrayp make-vector nil 0] 14 (#$ . 30408)]) #@49 Like `kill-line', but no kill ring. (fn COUNT) (defalias 'ses-delete-line #[257 "`y\210\211`|\207" [] 4 (#$ . 30878)]) #@75 Signal an error if PRINTER is not a valid SES cell printer. (fn PRINTER) (defalias 'ses-printer-validate #[257 "\211\203+\211;\204+\2119\203\301\"\204+\302!\204+\211\242;\203&\211A\203+\303\304\"\210\207" [ses--local-printer-hashmap gethash functionp error "Invalid printer function %S"] 4 (#$ . 31005)]) #@137 Add PRINTER to `ses-read-printer-history' if not already there, after first checking that it is a valid printer function. (fn PRINTER) (defalias 'ses-printer-record #[257 "\301!\210\211\205\302!\211\235\203\202\211B\211\262\207" [ses-read-printer-history ses-printer-validate prin1-to-string] 4 (#$ . 31330)]) #@114 If FORMULA is of the form \='SYMBOL, add it to the list of symbolic formulas for this spreadsheet. (fn FORMULA) (defalias 'ses-formula-record #[257 "\211\242\301=\205%\211A@9\205%\302A@!C\211\235\203\202#\211B\211\262\207" [ses--symbolic-formulas quote symbol-name] 4 (#$ . 31661)]) #@109 Return the alphabetic name of column number COL. 0-25 become A-Z; 26-701 become AA-ZZ, and so on. (fn COL) (defalias 'ses-column-letter #[257 "\300\301\302\246\\!\302W\203\211\202\303\302\245S!P\207" [char-to-string 65 26 ses-column-letter] 5 (#$ . 31963)]) #@77 Produce a symbol that names the cell (ROW,COL). (0,0) => A1. (fn ROW COL) (defalias 'ses-create-cell-symbol #[514 "\300\301!\302T!P!\207" [intern ses-column-letter number-to-string] 6 (#$ . 32236)]) #@91 Decode a symbol "A1" => (0,0). Return nil if STR is not a canonical cell name. (fn STR) (defalias 'ses-decode-cell-symbol #[257 "\301\302\303\"\205H\304\305\"\306\305GS\307\304\310\"!S\211\306Y\205FH\311Z_\\\262\312_\262S\262\306Y\203C\\\211\262\204 \211B\266\205)\207" [case-fold-search nil string-match "\\`\\([A-Z]+\\)\\([0-9]+\\)\\'" match-string-no-properties 1 0 string-to-number 2 65 26] 9 (#$ . 32445)]) #@95 Create buffer-local variables for cells. This is undoable. (fn MINROW MAXROW MINCOL MAXCOL) (defalias 'ses-create-cell-variable-range #[1028 "\301\302\257B\303\211\211ZT\304\211W\205^\211ZT\304\211W\203U\211 \\\262\211 \\\262\305\"\262 \306 \307\n\nB#\210\310 !\266\211T\262\202\"\266\211T\262\202\266\202\207" [buffer-undo-list apply ses-destroy-cell-variable-range nil 0 ses-create-cell-symbol put ses-cell make-local-variable] 18 (#$ . 32889)]) #@248 Create a buffer-local variable `SYM' for cell at position (ROW, COL). SYM is the symbol for that variable, ROW and COL are integers for row and column of the cell, with numbering starting from 0. Return nil in case of failure. (fn SYM ROW COL) (defalias 'ses-create-cell-variable #[771 "\303!?\205>\304!\210\305\306\307!\305\310\311#)\266\203)\203(\312\313B#\207\312\313\314#\210\n\2066\315\316\317\"\320B\n#\207" [case-fold-search inhibit-changing-match-data ses--named-cell-hashmap local-variable-p make-local-variable nil "\\`[A-Z]+[0-9]+\\'" symbol-name t string-match put ses-cell :ses-named make-hash-table :test eq puthash] 10 (#$ . 33384)]) #@96 Destroy buffer-local variables for cells. This is undoable. (fn MINROW MAXROW MINCOL MAXCOL) (defalias 'ses-destroy-cell-variable-range #[1028 "\304ZT\305\211W\203j\211ZT\305\211W\203a\211 \\\n\\W\203;\211 W\203;\nHH\211\305H\262\202?\306\"\262 \266\307!\203T\310\311\211JF B\312!\266\211T\262\202\266\211T\262\202\266\310\313\257 B\211\207" [ses--numrows ses--numcols ses--cells buffer-undo-list nil 0 ses-create-cell-symbol boundp apply ses-set-with-undo kill-local-variable ses-create-cell-variable-range] 16 (#$ . 34061)]) #@89 Flag the header string for update. Upon undo, the header string will be updated again. (defalias 'ses-reset-header-string #[0 "\302B\303\211\207" [buffer-undo-list ses--header-hscroll (apply ses-reset-header-string) -1] 2 (#$ . 34643)]) #@156 If `ses-start-time' is more than a second ago, call `message' with FORMAT and ARGS and reset `ses-start-time' to the current time. (fn FORMAT &rest ARGS) (defalias 'ses--time-check '(macro . #[385 "\300\301\302BB\303BBB\207" [when (time-less-p 1 (time-since ses-start-time)) message ((setq ses-start-time (float-time)))] 7 (#$ . 34891)])) #@196 Install VAL as the contents for field FIELD (named by a quoted symbol) of cell (ROW,COL). This is undoable. The cell's data will be updated through `post-command-hook'. (fn ROW COL FIELD VAL) (defalias 'ses-set-cell '(macro . #[1028 "\300\301D\302D\303DE\304\305\306@\307=\204\310\311!\210A@\211\312=\203(\313\202F\314\315\316\"!\317\320\321\322D\323\324\325\326B\327BBEED\330BB\262\262DD\331BB\332BBB\207" [let row col val let* (cell (ses-get-cell row col)) change quote cl--assertion-failed (eq (car field) 'quote) value (ses-set-with-undo (ses-cell-symbol cell) val) intern-soft format "ses-cell--%s" ses-setter-with-undo eval-when-compile cons function lambda (newval cell) setf (cell) (newval) (val cell) ((if change (add-to-list 'ses--deferred-write (cons row col)))) (nil)] 20 (#$ . 35240)])) #@370 Store a new formula for (ROW . COL) and enqueue the cell for recalculation via `post-command-hook'. Updates the reference lists for the cells that this cell refers to. Does not update cell value or reprint the cell. To avoid inconsistencies, this function is not interruptible, which means Emacs will crash if FORMULA contains a circular list. (fn ROW COL FORMULA) (defalias 'ses-cell-set-formula #[771 "HH\211\306H\307H\310!\310!\311\312\211\211\211\313\n\"\203&\n\210\202*\211\nB\210\211\203\260\211@\211>\204\251\2119\205B\211\314N\211\315=\203S \205T\316 \"\202T\211\262\262\203\251@\211\262\fW\203\251A\211\262 W\203\251\317\fHH\211\320H\262\"HH\321\322#\211\203\247B\211\235\203\240\210\202\246\211B\210\266A\266\202\202-\210\211\203I\211@\2119\205\300\211\314N\211\315=\203\321 \205\322\316 \"\202\322\211\262\262\2032@\211\262\fW\2032A\211\262 W\2032HH\211\320H\262\262 >\204B BHH\321\323#\211\203-B\211\235\203&\210\202,\211B\210\266\202B\211\313\"\204A\211B\262\210A\266\202\202\262\210\324 !\210\f\f\fHH\321\325#\211\203zB\211\235\203s\210\202y\211B\210\266\205\204\326\327\")\266\210\207" [ses--cells inhibit-quit ses--deferred-recalc ses--named-cell-hashmap ses--numrows ses--numcols 1 0 ses-formula-references t nil memql ses-cell :ses-named gethash delq 3 ses-setter-with-undo (ses-cell--references . #[514 "\211\211\300I\207" [3] 6 "\n\n(fn NEWVAL CELL)"]) (ses-cell--references . #[514 "\211\211\300I\207" [3] 6 "\n\n(fn NEWVAL CELL)"]) ses-formula-record (ses-cell--formula . #[514 "\211\211\300I\207" [1] 6 "\n\n(fn NEWVAL CELL)"]) error "Found in formula cells not in spreadsheet: %S" ses--deferred-write] 23 (#$ . 36067)]) #@72 Repair cell reference and warn if there was some reference corruption. (defalias 'ses-repair-cell-reference-all #[0 "\305\306\211W\203[\211 \306\211W\203R\211\nHH\211\307\310H\236\211A\203/\310\311\310H\"I\210\266\202\262\211\203I\nHH\211\306H\262\312EB\262\266\211T\262\202\f\266\211T\262\202\266\306\211W\203\364\211 \306\211W\203\353\211\nHH\211\306H\313H\314!\211\211\203\342\211@\2119\205\214\211\315N\211\316=\203\235 \205\236\317 \"\202\236\211\262\n@HAH\211\307\310H\236\211A\320\"\203\273\211\202\276B\262\203\313\241\210\202\331\310\307B\211\262\310HBI\210\266A\266\202\202~\266\211T\262\202h\266\211T\262\202_\266\306\211W\203\251\211 \306\211W\203\240\211\nHH\211\321H\307\310H\236\211A\203'\310\311\310H\"I\210\266\202\305\211\203M\211@\211>\203A\311\"\262\202F\211B\262A\266\202\202+\210\nHH\322\323#\211\203sB\211\f\235\203n\f\210\202r\211\fB\210\266\211\204}\203\227\306H\324\205\210\325D\205\220\326D\"B B\262 \266\211T\262\202\266\211T\262\202\370\266\211\203\266\327\330\"\202\271\331\332!\207" [ses--numrows ses--numcols ses--cells ses--named-cell-hashmap ses--deferred-write nil 0 :ses-repair-reference 4 delq :corrupt-property 1 ses-formula-references ses-cell :ses-named gethash memql 3 ses-setter-with-undo (ses-cell--references . #[514 "\211\211\300I\207" [3] 6 "\n\n(fn NEWVAL CELL)"]) append :missing :irrelevant warn "----------------------------------------------------------------\nSome references were corrupted.\n\nThe following is a list where each element ELT is such\nthat (car ELT) is the reference of cell CELL with corruption,\nand (cdr ELT) is a property list where\n\n* property `:corrupt-property' means that\n property `:ses-repair-reference' of cell CELL was initially non\n nil,\n\n* property `:missing' is a list of missing references\n\n* property `:irrelevant' is a list of non needed references\n\n%S" message "No reference corruption found"] 24 (#$ . 37874) "*"]) #@483 Calculate and print the value for cell (ROW,COL) using the cell's formula function and print functions, if any. Result is nil for normal operation, or the error signal if the formula or print function failed. The old value is left unchanged if it was *skip* and the new value is nil. Any cells that depend on this cell are queued for update after the end of processing for the current keystroke, unless the new value is the same as the old and FORCE is nil. (fn ROW COL FORCE) (defalias 'ses-calculate-cell #[771 "HH\306\211\211\307HJ\310H\306\211\242\311=\203G\311A@!\262\n\nHH\312\313#\211\203EB\211 \235\203@ \210\202D\211 B\210\266\3141V\315\316\"\211\2620\202g\211 \307HC\244\210\211\262\317\211\262\262\210\204u\320=\203u\320\262\3212\271\204\205=?\205\270\n\nB\211 \235\203\224 \202\227\211 B\262\322\323H\236\211A\211\204\313\n\307B\211\262\203\270\241\210\202\307\323\322B\211\262\323HBI\210\210\202\332\n@U\204\332\211\n\240\210\211\307\241\210\211AT\266\204\n\nHH\324\307H\"\211\203B\211 \235\203 \210\202\211 B\210\266\325H\211\205\266\211@\211\326 \"\203 \210\202#\211 B\210\2119\205,\211\327N\211\330=\203=\f\205>\331\f\"\202>\211\262@HAH\211\322\323H\236\211A\211\204x\nB\211\262\203e\241\210\202t\323\322B\211\262\323HBI\210\210\202\223\211@\nU\203\212\211A ]\241\210\202\223\211\n\240\210\211\241\210\266 V\203\257\332\321\333\334\335\307H\"D\262\n \211\262\f\"\210A\266\202\202\f\2620\266\336\"\262\203\317\333\337!!\206\324\206\324\211\207" [ses--cells ses--deferred-write ses--Dijkstra-attempt-nb ses--deferred-recalc ses--named-cell-hashmap ses--Dijkstra-weight-bound nil 0 1 ses-safe-formula ses-setter-with-undo (ses-cell--formula . #[514 "\211\211\300I\207" [1] 6 "\n\n(fn NEWVAL CELL)"]) (error) eval t *error* *skip* cycle :ses-Dijkstra-attempt 4 ses-set-with-undo 3 memql ses-cell :ses-named gethash throw error format "Found cycle on cells %S" ses-print-cell error-message-string] 24 (#$ . 39940)]) #@62 Delete formula and printer for cell (ROW,COL). (fn ROW COL) (defalias 'ses-clear-cell #[514 "\302HH\303\304#\211\203$B\211 \235\203 \210\202#\211 B\210\266\305\302#\207" [ses--cells ses--deferred-write nil ses-setter-with-undo (ses-cell--printer . #[514 "\211\211\300I\207" [2] 6 "\n\n(fn NEWVAL CELL)"]) ses-cell-set-formula] 10 (#$ . 42025)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable ses-self-reference-early-detection funcall function #[0 "\300\207" [nil] 1] "True if cycle detection is early for cells that refer to themselves." :version "24.1" :type boolean :group ses] 10) #@215 Recalculate cells in LIST, checking for dependency loops. Prints progress messages every second. Dependent cells are not recalculated if the cell's value is unchanged and FORCE is nil. (fn LIST &optional FORCE) (defalias 'ses-update-cells #[513 "\211`\306\211\211\211\211\307\306C\310\311\312\313\314\"\315\"\316$\216\203+\211\317 \240\210\320\321\"\210\203\2039\320\322G\"\210\262\306\262\203\343\211A\262\242\2629\205X\323N\211\324=\203j \205k\325 \"\202k\211\262\262\n@HAH\211\326H\262\262\3272\312\330!\211\205\307\211@ \203\236\211=\203\236\331\332\"\210\202\300\211 >\204\253\211>\203\300\235\203\266\202\272B\333\327\334\"\210A\266\202\202\204\2620\204B\f\203\327\331\335!\204B\336@A #\210\202B\211\203\211@\211 \235\203\366\n\202\372\211 B\262 A\266\202\202\344\210\202+\203l\211\203f\211@\2119\205\211\323N\211\324=\203+ \205,\325 \"\202,\211\262\211@A\337\nHH\340\311H\"\211\203UB\211 \235\203P \210\202T\211 B\210\266\341@A\"\266A\266\202\202\f\210\331\342\"\210\320\307!\210)\266b)\207" [ses--deferred-recalc ses--named-cell-hashmap ses--cells ses-self-reference-early-detection quit-flag ses--deferred-write nil " " make-byte-code 0 "\300\205\301\242\203\302\303\301\242\"\207\302\304!\207" vconcat vector [message #1="%s" nil] 3 current-message message #1# "Recalculating... (%d cells left)" ses-cell :ses-named gethash 1 ref ses-formula-references error "Cycle found: cell %S is self-referring" throw t "Quit" ses-calculate-cell *error* ses-set-with-undo ses-print-cell "Circular references: %s"] 23 (#$ . 42684)]) #@52 Return t if point is in print area of spreadsheet. (defalias 'ses-in-print-area #[0 "`X\207" [ses--data-marker] 2 (#$ . 44347)]) #@60 Move point to print area for cell (ROW,COL). (fn ROW COL) (defalias 'ses-goto-print #[514 "\301eb\210y\210\301\211W\203!\211\302H\303#\262\210\211T\262\202 \266\211\304!V\2051l\2051\305u\207" [ses--col-widths 0 + 1 move-to-column nil] 10 (#$ . 44483)]) #@29 (fn POS &optional OBJECT) (defalias 'ses--cell-at-pos #[513 "\300\301#\207" [get-text-property cursor-intangible] 6 (#$ . 44757)]) #@122 Return the current cell symbol, or a cons (BEG,END) for a region, or nil if cursor is not at a cell. (fn &optional POS) (defalias 'ses--curcell #[256 "\211\204`\262\203 \204\211\303\304!U\203\305!\207\211\303\304!]\305\303\304!^!\305S!\nU\2039\305\306 \307Z!\262\205D\211\205DB\207" [mark-active deactivate-mark ses--data-marker mark t ses--cell-at-pos region-end 2] 7 (#$ . 44899)]) #@117 Set `ses--curcell' to the current cell symbol, or a cons (BEG,END) for a region, or nil if cursor is not at a cell. (defalias 'ses-set-curcell #[0 "\300 \301\207" [ses--curcell nil] 1 (#$ . 45312)]) #@245 Signal an error if `ses--curcell' is inappropriate. The end marker is appropriate if some argument is `end'. A range is appropriate if some argument is `range'. A single cell is appropriate unless some argument is `needrange'. (fn &rest ARGS) (defalias 'ses-check-curcell #[128 "\301 \210\204\302>\206/\303\304!\207:\203&\305>\206/\306>\206/\303\307!\207\306>\205/\303\310!\207" [ses--curcell ses-set-curcell end error "Not at cell" range needrange "Can't use a range" "Need a range"] 3 (#$ . 45519)]) #@498 Format and print the value of cell (ROW,COL) to the print area. Use the cell's printer function. If the cell's new print form is too wide, it will spill over into the following cell, but will not run off the end of the row or overwrite the next non-nil field. Result is nil for normal operation, or the error signal if the printer function failed and the cell was formatted with "%s". If the cell's value is *skip*, nothing is printed because the preceding cell has spilled over. (fn ROW COL) (defalias 'ses-print-cell #[514 "\3062[HH\211\307HJ\310HT\311\211\211\211\312\267\2021\313\306\311\"\210\202\215\314 \nH\315\"\262\202\215\242\316=\203h  \316A@!\211\262 HH\317\320#\211\203fB\211\n\235\203a\n\210\202e\211\nB\210\266  \321\206} \nH\206}2\"*\2623:\203\2153\262  H\322!\211W\203\270\314Z\323\"\2623\324=\203\257P\202\263\211P\262\202\216\211V\203\216V\203%4W\203% HH\211\307H\262J\211\262\203\346\325=\203%\204\f\325HH\326\307H\"\211\203B\211\n\235\203\f\n\210\202\211\nB\210\266\327 \nH\330#\262T\262\202\277X\2039\314Z\323\"P\262\202\215\331\332E\262 ;\203R\333\307\323$\262\202\215 \247\203\207\334\335\"\203\207\307\336\307\225\307\224Z#\211\262Y\203\207\337\307\211\224Z#\337\307\225\"P\262\202\215\314\315\"\262\210\266\340\341\342#\262\343\n\n\"\210`\262\324\21156`\344i\322!\\!\210`T|\2104W\203\302\345\202\303\346P\262\347\307G\311$\210\350!\210\351`\352 \307H$\210 \307U\203\307U\203\351e`\353\354$\210\351e`\355\356$\210\351eeT\357\360$\210* 7SU\203 \361 \2104W\203T\nHH\211\307H\262J\325=\203T \311HH\326\307H\"\211\203KB\211\n\235\203F\n\210\202J\211\nB\210\266\306\n\"\210b\210\266\2100\207" [ses--cells ses--col-widths ses--deferred-write ses--col ses--row ses--col-printers ses-print-cell 0 2 nil #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (*skip* 29 *error* 37)) throw make-string 35 ses-safe-printer ses-setter-with-undo (ses-cell--printer . #[514 "\211\211\300I\207" [2] 6 "\n\n(fn NEWVAL CELL)"]) ses-call-printer string-width 32 t *skip* ses-set-with-undo + 1 error "Too wide" truncate-string-to-width string-match "\\.[0-9]+" - substring replace-regexp-in-string "[ \n]" "?" ses-goto-print move-to-column " " "\n" set-text-properties insert-and-inherit put-text-property cursor-intangible keymap ses-mode-print-map read-only ses front-sticky (read-only keymap) ses-reset-header-string ses--default-printer ses-call-printer-return ses--numcols inhibit-quit inhibit-read-only ses--header-row] 21 (#$ . 46042)]) #@392 Invoke PRINTER (a string or parenthesized string or function-symbol or lambda of one argument) on VALUE. Result is the printed cell as a string. The variable `ses-call-printer-return' is set to t if the printer used parenthesis to request left-justification, or the error-signal if the printer signaled one (and "%s" is used as the default printer), else nil. (fn PRINTER &optional VALUE) (defalias 'ses-call-printer #[513 "\303\3041t;\203\211\203\305\"\202r\306\202r\242;\2032\307\211\203.\305@\"\202r\306\202r9\203V\310 \"\211\205Q\311!\n>\204N\312\313\314D\"\210\211\315H\262\206W!\262\211;\203d\211\202r\211\242;\204n\316\317!\210\307\211@0\207\211\320!\207" [ses-call-printer-return ses--local-printer-hashmap cl-struct-ses--locprn-tags nil (error) format "" t gethash type-of signal wrong-type-argument ses--locprn 2 error "Printer should return \"string\" or (\"string\")" ses-prin1] 7 (#$ . 48741)]) #@173 Insert CHANGE spaces in front of column COL, or at end of line if COL=NUMCOLS. Deletes characters if CHANGE < 0. Caller should bind `inhibit-quit' to t. (fn COL CHANGE) (defalias 'ses-adjust-print-width #[514 "\304\305V\205 \306\307\"U\310\302\n\\\"\210\310\311\306\n\307\"\312P\"\210 \305\211W\205P\211\313 \"\210\2038\314u\210\203Bc\210\202H\315[!\210\210\211T\262\202$\266\202)\207" [ses--numcols inhibit-read-only ses--linewidth ses--numrows t 0 make-string 32 ses-set-with-undo ses--blank-line "\n" ses-goto-print -1 delete-char] 11 (#$ . 49695)]) #@192 Same as `ses-print-cell', except if the cell's value is *skip*, the preceding nonskipped cell is reprinted. This function is used when the width of cell (ROW,COL) has changed. (fn ROW COL) (defalias 'ses-print-cell-new-width #[514 "HH\211\302H\262J\303=\204\304\"\207\305\"\210\306u\210\307`!9\205)\307`!\310N\211\311=\203< \205=\312\307`! \"\202=\211\262\304@A\"\207" [ses--cells ses--named-cell-hashmap 0 *skip* ses-print-cell ses-goto-print -1 ses--cell-at-pos ses-cell :ses-named gethash] 6 (#$ . 50281)]) #@61 Turn off narrowing, to be reenabled at end of command loop. (defalias 'ses-widen #[0 "deZ\301 U\204 \302~\207" [ses--deferred-narrow buffer-size t] 2 (#$ . 50816)]) #@258 Move point to data area for (DEF,COL). If DEF is a row number, COL is the column number for a data cell -- otherwise DEF is one of the symbols ses--col-widths, ses--col-printers, ses--default-printer, ses--numrows, or ses--numcols. (fn DEF &optional COL) (defalias 'ses-goto-data #[513 "\304 \210\211\203b\210\305\306 T_#y\207\307\n\"\262\204#\310\311\312\"\210 b\210y\207" [ses--data-marker ses--numcols ses-paramlines-plist ses--params-marker ses-widen + 1 plist-get signal args-out-of-range nil] 6 (#$ . 50990)]) #@279 Extend the global parameters list when file format is updated from 2 to 3. This happens when local printer function are added to a sheet that was created with SES version 2. This is not undoable. Return nil when there was no change, and non-nil otherwise. (fn NEW-FILE-FORMAT) (defalias 'ses-file-format-extend-parameter-list #[257 "\212\305U\205.\211\306U\205.\307\300\306\"\210\310\311!\210\312 \210 b\210\313\n\304\"y\210\314\313 \304\"\f\"\315\261\210\316)\207" [ses--file-format ses--params-marker ses-paramlines-plist ses-paramfmt-plist ses--numlocprn 2 3 ses-set-parameter message "Upgrading from SES-2 to SES-3 file format" ses-widen plist-get format 10 t] 5 (#$ . 51525)]) #@263 Set parameter DEF to VALUE (with undo) and write the value to the data area. See `ses-goto-data' for meaning of DEF. Newlines in the data are escaped. If ELEM is specified, it is the array subscript within DEF to be set to VALUE. (fn DEF VALUE &optional ELEM) (defalias 'ses-set-parameter #[770 "\212\303!\210\304\305\"\306\203!JH\262JI\210\202)J\262L\210\306`\307 |\210\310J\"c\210)\311\312\257\nB\211)\266\203)\207" [ses-paramfmt-plist inhibit-read-only buffer-undo-list ses-goto-data t plist-get nil line-end-position format apply ses-set-parameter] 11 (#$ . 52219)]) #@107 Write cells in `ses--deferred-write' from local variables to data area. Newlines in the data are escaped. (defalias 'ses-write-cells #[0 "\306\211\307\211\211\211\211\211\211\211\310 \311\307C\312\313\314\315\316\"\317\"\320$\216\203/\211\321 \240\210\322\323\"\210\212 \203\274\324\325\326\n!\"\203F\322\327 G\"\210\310  \211A\242\262\n @\262  A\262\f HH\262\313H\262\325H\262\330H\262\242\331=\203~A@\262\242\332=\203\212A@\262\333\334\211J\nJ\232?\205\234\f\320H\257!\262\335  \"\210\306`\336 |\210c\210)\2020)\322\311!)\266\202*\207" [inhibit-read-only print-escape-newlines ses-start-time ses--deferred-write ses--cells inhibit-quit t nil float-time " " make-byte-code 0 "\300\205\301\242\203\302\303\301\242\"\207\302\304!\207" vconcat vector [message #1="%s" nil] 3 current-message message #1# time-less-p 1 time-since "Writing... (%d cells left)" 2 ses-safe-formula ses-safe-printer prin1-to-string ses-cell ses-goto-data line-end-position] 19 (#$ . 52829)]) #@254 Produce a list of symbols for cells that this FORMULA's value refers to. For recursive calls, RESULT-SO-FAR is the list being constructed, or t to get a wrong-type-argument error when the first reference is found. (fn FORMULA &optional RESULT-SO-FAR) (defalias 'ses-formula-references #[513 "9\205\301N\211\302=\203\205\303\"\202\211\262\2031\235\203)\211\202,B\262\202\204:\203\204@\304=\203h\305\304A@\3068E!A\211\203d\211@\211\235\203X\202[\211B\262A\266\202\202H\210\202\204@\307=\204\204\211\203\203\211@\310\"\262A\266\202\202p\210\207" [ses--named-cell-hashmap ses-cell :ses-named gethash ses-range macroexpand 2 quote ses-formula-references] 7 (#$ . 53863)]) #@209 Relocate one symbol SYM, which corresponds to ROWCOL (a cons of ROW and COL). Cells starting at (STARTROW,STARTCOL) are being shifted by (ROWINCR,COLINCR). (fn SYM ROWCOL STARTROW STARTCOL ROWINCR COLINCR) (defalias 'ses-relocate-symbol #[1542 "@AW\204\211W\203\202d\\\262\211\\\262Y\205d\211Y\205dW\205d\211 W\205d\303N\304=\203G\202d\nHH\211\305H\262\211\262 \303N\304=\203`\202d\306\"\207" [ses--numrows ses--numcols ses--cells ses-cell :ses-named 0 ses-create-cell-symbol] 11 (#$ . 54587)]) (put 'ses-relocate-symbol 'byte-optimizer 'byte-compile-inline-expand) #@548 Produce a copy of FORMULA where all symbols that refer to cells in row STARTROW or above, and col STARTCOL or above, are altered by adding ROWINCR and COLINCR. STARTROW and STARTCOL are 0-based. Example: (ses-relocate-formula \='(+ A1 B2 D3) 1 2 1 -1) => (+ A1 B2 C4) If ROWINCR or COLINCR is negative, references to cells being deleted are removed. Example: (ses-relocate-formula \='(+ A1 B2 D3) 0 1 0 -1) => (+ A1 C3) Sets `ses-relocate-return' to `delete' if cell-references were removed. (fn FORMULA STARTROW STARTCOL ROWINCR COLINCR) (defalias 'ses-relocate-formula #[1285 "\305\211:\203@\306=\203\2569\205\307N\211\310=\203,\205-\311\"\202-\211\262\211\262\203\251@AW\204Q\211W\203V\202\244\\\262\211\\\262Y\205\244\211Y\205\244 W\205\244\211\nW\205\244\307N\310=\203\207\202\244 HH\211\312H\262\211\262 \307N\310=\203\240\202\244\313\"\266\210\202\254\202\254\211\203\251\211@\2119\205\276\211\307N\211\310=\203\317\205\320\311\"\202\320\211\262\262\203_\211    @AW\204\363\211W\203\370\202F\\\262\211\\\262Y\205F\211Y\205F W\205F\211\nW\205F\307N\310=\203)\202F HH\211\312H\262\211\262 \307N\310=\203B\202F\313\"\266\210\262\211\203V\211B\262\202\242\f\204\242\314\202\242\211\242\315=\203\316    %\262\211\203\242\211B\262\202\242\211:\203\213\211@\306=\203\223\211B\262\202\242\317    %B\262A\266\202\202\260\210\211\237\207" [ses--named-cell-hashmap ses--numrows ses--numcols ses--cells ses-relocate-return nil quote ses-cell :ses-named gethash 0 ses-create-cell-symbol delete ses-range ses-relocate-range ses-relocate-formula] 20 (#$ . 55205)]) #@455 Relocate one RANGE, of the form (ses-range MIN MAX). Cells starting at (STARTROW,STARTCOL) are being shifted by (ROWINCR,COLINCR). Result is the new range, or nil if the entire range is deleted. If new rows are being added just beyond the end of a row range, or new columns just beyond a column range, the new rows/columns will be added to the range. Sets `ses-relocate-return' if the range was altered. (fn RANGE STARTROW STARTCOL ROWINCR COLINCR) (defalias 'ses-relocate-range #[1285 "A@\2119\205 \211\305N\211\306=\203\205\307\"\202\211\262@AW\204:\211W\203?\202\215\\\262\211\\\262Y\205\215\211Y\205\215 W\205\215\211\nW\205\215\305N\306=\203p\202\215 HH\211\310H\262\211\262 \305N\306=\203\211\202\215\311\"\266\210\3128\2119\205\233\211\305N\211\306=\203\254\205\255\307\"\202\255\211\262\n\n\n\n@AW\204\312\211W\203\317\202\\\262\211\\\262Y\205\211Y\205 W\205\211\nW\205\305N\306=\203\202 HH\211\310H\262\211\262 \305N\306=\203\202\311\"\266\210\313\204.\204.\313\262\f\202\360\310U\203\225\314\262\204G\311 A\"\262\315\204m\310V\203^\311 SA\"\262\202\360\311 SA\"\262\315\202\360\310V\203\360@ SU\203\360AAU\203\360\311\316\f \317#A\"\262\202\360\320\262\204\247\311@ \"\262\315\204\313\310V\203\275\311@\nS\"\262\202\360\311@ S\"\262\315\202\360\310V\203\360A\nSU\203\360@@U\203\360\311@\316\f \317#\"\262 \205N\211!!Z9\205\305N\211\306=\203\205\307\"\202\211\262!9\205&\305N\211\306=\2038\2059\307 \"\2029\211\262!ZU\204C\315\321AAABBB\207" [ses--named-cell-hashmap ses--numrows ses--numcols ses--cells ses-relocate-return ses-cell :ses-named gethash 0 ses-create-cell-symbol 2 nil car range + -1 cdr ses-range] 21 (#$ . 56948)]) #@206 Alter all cell values, symbols, formulas, and reference-lists to relocate the rectangle (MINROW,MINCOL)..(NUMROWS,NUMCOLS) by adding ROWINCR and COLINCR to each symbol. (fn MINROW MINCOL ROWINCR COLINCR) (defalias 'ses-relocate-all #[1028 "\306\211\211\211\307;\203\310\311#\262\211\311\211W\203w\211 \311\211W\203W\211\306 HH\262 \312 \313H%\262\nZ\262  HH\314\315#\211\203hB\211\f\235\203c\f\210\202g\211\fB\210\266\n\316=\203xB\fB\262\f\n\203\220\317\"\211 \235\203\212 \202\215\211 B\262\312 \320H%\262\n HH\314\321#\211\203\305B\211\f\235\203\300\f\210\202\304\211\fB\210\266Y\203O\211Y\203O HH\211\311H\262Z\203 \n\311Y\203 \211\311Y\203 \322N\323=\203 \324B*#\210\202M\317\"\211\262 HH\314\325#\211\2035B\211\f\235\2030\f\210\2024\211\fB\210\266\326!\204M\327!\306L\210\330\322B#\210\266\210\211T\262\202\266T\306\247\203i@Y\205n\331#\266\211T\262\202\266\332!\266\306\211\211\211\211\211\311X\203\240\311X\203\240\333\fZ;\203\243\310\311#\262\211\311\211W\203^\211\211\\\262\n Z\311\211W\203>\211\211\\\262\f\fZ\262  Z\262\n  H\fH\211\311H\262\262 \322N\323=\2046\f\f\fW\203  W\203   H\fH\211\311H\262J\202\317  \"J HH\334\311H\"\211\2034B\211\f\235\203/\f\210\2023\211\fB\210\266\210\211T\262\202\267\266T\306\247\203P@Y\205U\331#\266\211T\262\202\245\266\332!\266+\203\220\335\336!\210\337 ,+\203\231\340\313\341,!\"\203\214\335\342+G\"\210\337 ,\343+\211A+\242!\210\202r\335\306!\210\202\220\344 !\203\214\344!\203\214S S\306\211\333Z;\203\305\310\311#\262\211\311\211W\203\202\211Z\262 Z\311\211W\203b\211\nZ\262  Z\262Z\262 \nH H\211\311H\262\262 \f\322N\323=\204ZW\204 W\203!\306\262\2020 HH\211\311H\262J\262   HH\334\311H\"\211\203XB\211\f\235\203S\f\210\202W\211\fB\210\266\210\211T\262\202\331\266T\306\247\203t@Y\205y\331#\266\211T\262\202\307\266\332!\266\202\220\345\346!\210\266\211\205\335\335\347!\210\306\211\337 ,\203\330\340\313\341,!\"\203\270\335\350G\"\210\337 ,@@\262@A\262A\262\351 HH\211\313H\262#\210\202\240\266\335\306!\207" [ses--numrows ses--numcols ses-relocate-return ses--cells ses--deferred-write ses--deferred-recalc nil "Relocating formulas..." make-progress-reporter 0 ses-relocate-formula 1 ses-setter-with-undo (ses-cell--formula . #[514 "\211\211\300I\207" [1] 6 "\n\n(fn NEWVAL CELL)"]) range ses-create-cell-symbol 3 (ses-cell--references . #[514 "\211\211\300I\207" [3] 6 "\n\n(fn NEWVAL CELL)"]) ses-cell :ses-named puthash (ses-cell--symbol . #[514 "\211\211\300I\207" [0] 6 "\n\n(fn NEWVAL CELL)"]) local-variable-if-set-p make-local-variable put progress-reporter-do-update progress-reporter-done "Relocating variables..." ses-set-with-undo message "Unbinding killed named cell symbols..." float-time time-less-p time-since "Unbinding killed named cell symbols... (%d left)" ses--unbind-cell-name wholenump error "ROWINCR and COLINCR must have the same sign" "Fixing ses-ranges..." "Fixing ses-ranges... (%d left)" ses-cell-set-formula ses--named-cell-hashmap ses--in-killing-named-cell-list ses-start-time] 31 (#$ . 58846)]) #@65 For undo, remember point before we start changing hidden stuff. (defalias 'ses-begin-change #[0 "\301\302\303!\210`S`|)\207" [inhibit-read-only t insert-and-inherit "X"] 2 (#$ . 62195)]) #@140 Set a field/variable and record it so it can be undone. Result is non-nil if field/variable has changed. (fn ACCESSORS NEWVAL &rest ARGS) (defalias 'ses-setter-with-undo #[642 "\301@\"\302\"?\205!\301\303BBBBB\301A#\210\304\207" [buffer-undo-list apply equal-including-properties ses-setter-with-undo t] 9 (#$ . 62390)]) #@25 (fn ARRAY IDX NEWVAL) (defalias 'ses-aset-with-undo #[771 "\300\301$\207" [ses-setter-with-undo (aref . #[771 "I\207" [] 6 "\n\n(fn NEWVAL ARRAY IDX)"])] 8 (#$ . 62731)]) #@19 (fn SYM NEWVAL) (defalias 'ses-set-with-undo #[514 "\300\301#\207" [ses-setter-with-undo (#[257 "\300!\203 \211J\207\301\207" [boundp :ses--unbound] 3 "\n\n(fn SYM)"] . #[514 "\300=\203\n\301!\207\211L\207" [:ses--unbound makunbound] 4 "\n\n(fn NEWVAL SYM)"])] 6 (#$ . 62916)]) #@112 Parse the current buffer and set up buffer-local variables. Does not execute cell formulas or print functions. (defalias 'ses-load #[0 "~\210db\210\306\307\310\311#\210\312\313!\210\314 \3151\316p!0\202\210\310\317!\211\320Y\203h\211\321X\203h@\247\203hA@\247\203hA@\322Y\203h\3238\247\203h\3238\322V\203h\211\320X\204l\3208\211\250\205c\211\322Y\262\204l\324\325!\210@A@\3238\3208\206~\322 \313U\203\230\310\326\327!\210\330c\210\331\301\320\"\210\332\333!\210) \320X\204\242\324\334!\210\335\n\310\"6\n\322\211W\203\302\2116\335 \310\"I\266\211T\262\202\252\266\3367!\266eb\210\ny\2108\3119\337!)\262\204\342\324\340!\210\313u\210\314 :8GSu\210\341\342;\"\210\310<\212\n T_y\210\f\322\211\322\211W\2033\211\316p!g\343U\203#\211\242\344=\203#\345\346A\"\204'\324\347!\210\fT\266\211T\262\202\266)\n\322\211W\203\221\211 \322\211W\203v\211\316p!\211\243\242g\343U\203d\242\350=\203d\351#\204h\324\352!\210\345\353A\"\266\211T\262\202A\266\354\3119\337!)\262\204\211\324\355!\210\210\211T\262\2028\266\323\f\\y\210\316p!`f\316p!`f\316p!`f\316p!`f\242\356=\203\342\343U\203\342\242\357=\203\342\343U\203\342\242\360=\203\342\343U\203\342\242\361=\203\342\211\343U\204\346\324\362!\210\363\311\"\210\363\311\"\210\363\311\"\210\363\311\"\266 \313u\210=\3119\337!)\262\204\324\364!\210\320y\210`\326\302!\210`U\206#\324\365!\207" [ses--params-marker ses--file-format ses--numrows ses--numcols ses--numlocprn buffer-undo-list search-backward ";; Local Variables:\n" nil t backward-list 1 point-marker (error) read safe-length 3 4 0 2 error "Invalid SES file" ses-goto-data ses--header-row "(ses-header-row 0)\n" ses-set-parameter message "Upgrading from SES-1 to SES-2 file format" "This file needs a newer version of the SES library code" make-vector clrhash looking-at "Missing marker between print and data areas" mapc ses-printer-record 10 ses-local-printer apply ses--local-printer "local printer-def error" ses-cell ses-create-cell-variable "Cell-def error" ses--cell "\n\n" "Missing blank line between rows" ses-column-widths ses-column-printers ses-default-printer ses-header-row "Invalid SES global parameters" eval "Problem with column-defs or global-params" "Extraneous newlines someplace?" ses--cells ses--local-printer-hashmap ses-print-data-boundary inhibit-changing-match-data ses--data-marker ses-standard-printer-functions ses--symbolic-formulas ses-initial-global-parameters-re] 12 (#$ . 63211)]) #@193 Set up for display of only the printed cell values. Narrows the buffer to show only the print area. Gives it `read-only' and `intangible' properties. Sets up highlighting for current cell. (defalias 'ses-setup #[0 "e\306\211\307 \310\211\310\311\312\313\314\315!\316\"\317$\216\320\312\211\"\210\321`d\306#\210\322\323\324ed\"\"\210\325e`S\326\327$\210\325e`S\330\331$\210\325eeT\332\333$\210\334 ;\203P\335\312#\262\211\312\211W\203\211\f\312\211W\203\341\211 \262 HH\211\312H\262\262\n J\336=\204\331\211\fSW\203\244 HTH\211\312H\262J\336=\203\244\337\f)H\340#\262\f\211T\262\202z\212\nb\210\341\337iZ)H#!\210l\203\310\337\f)H\340#\202\314\306u\210`)\262\f\325  \342 $\210\210\211T\262\202[\266T\306\247\203\363@Y\205\370\343#\266\211T\262\202R\266\344!\266,\266\345eTeT\"*\346*\347\350#\207" [buffer-undo-list inhibit-read-only inhibit-modification-hooks ses--numrows ses--numcols ses--cells nil buffer-modified-p t make-byte-code 0 "\300?\205\301\302!\207" vconcat vector [restore-buffer-modified-p nil] 2 ses-goto-data set-text-properties mapc delete-overlay overlays-in put-text-property read-only ses keymap ses-mode-print-map front-sticky (read-only keymap) "Finding cells..." make-progress-reporter *skip* + 1 move-to-column cursor-intangible progress-reporter-do-update progress-reporter-done make-overlay overlay-put face underline ses--col-widths ses--curcell-overlay] 19 (#$ . 65751) nil]) #@114 Cleanup when changing a buffer from SES mode to something else. Delete overlays, remove special text properties. (defalias 'ses-cleanup #[0 "~\210\302\303\304 \305ed\303#\210\306\307\310ed\"\"\210\211?\205 \311\303!*\207" [buffer-file-name inhibit-read-only t nil buffer-modified-p set-text-properties mapc delete-overlay overlays-in restore-buffer-modified-p] 8 (#$ . 67234)]) #@41 Hook when the current buffer is killed. (defalias 'ses-killbuffer-hook #[0 "\301p\"\211\207" [ses--ses-buffer-list delq] 3 (#$ . 67623)]) #@1401 Major mode for Simple Emacs Spreadsheet. When you invoke SES in a new buffer, it is divided into cells that you can enter data into. You can navigate the cells with the arrow keys and add more cells with the tab key. The contents of these cells can be numbers, text, or Lisp expressions. (To enter text, enclose it in double quotes.) In an expression, you can use cell coordinates to refer to the contents of another cell. For example, you can sum a range of cells with `(+ A1 A2 A3)'. There are specialized functions like `ses+' (addition for ranges with empty cells), `ses-average' (for performing calculations on cells), and `ses-range' and `ses-select' (for extracting ranges of cells). Each cell also has a print function that controls how it is displayed. Each SES buffer is divided into a print area and a data area. Normally, you can simply use SES to look at and manipulate the print area, and let SES manage the data area outside the visible region. See "ses-example.ses" (in `data-directory') for an example spreadsheet, and the Info node `(ses)Top.' In the following, note the separate keymaps for cell editing mode and print mode specifications. Key definitions: \{ses-mode-map} These key definitions are active only in the print area (the visible part): \{ses-mode-print-map} These are active only in the minibuffer, when entering or editing a formula: \{ses-mode-edit-map} (defalias 'ses-mode #[0 "\306\300!\205 \307=?\205\336\310 \210\311 \210\307\312\313\314\313\3140\3131\315\316\317\313\314$\210\315\320\321\313\314$\210p\2112>\203>2\202B\2112B\2622\3223\323\324!\210\325\315\326\327\330\314$\210\331\332!\210\333 \334U\335 \212\203j4c\210\336 \210\337 \210)\203\30556\232\204\202\3405!\21078\334HU\204\222\341\3347\"\210\342 \2109@:V\203\245\3439@S!\2109A;V\203\265\3449AS!\210\345 \210\346!\210\347 \210\350 \210eb\210\266\351\205UGS%\210\210:\205a\323 \207" [derived-mode-p ses-mode get-text-property keymap ses-mode-print-map apply ses-check-curcell end push-mark current-kill 0 - -1 ses-yank-cells ses-yank-tsf ses-yank-one ses-yank-resize 1 (9 10) exchange-point-and-mark] 10 (#$ . 101964)]) (advice-add 'yank :around 'ses--advice-yank) #@371 Replace just-yanked stretch of killed text with a different stretch. This command is allowed only immediately after a `yank' or a `yank-pop', when the region contains a stretch of reinserted previously-killed text. We replace it with a different stretch of killed text. Unlike standard `yank-pop', this function uses `undo' to delete the previous insertion. (fn ARG) (defalias 'ses-yank-pop #[257 "\302=\204\303\304!\210\303\305!\210\306 \210\307 \210\302\206\310T!\210\302\211\207" [last-command this-command yank error "Previous command was not a yank" "Form marked with `noreturn' did return" undo ses-set-curcell 1] 3 (#$ . 103490) "*p"]) #@350 If the TEXT has a proper set of `ses' attributes, insert the text as cells, else return nil. The cells are reprinted--the supplied text is ignored because the column widths, default printer, etc. at yank time might be different from those at kill-time. ARG is a list to indicate that formulas are to be inserted without relocation. (fn TEXT ARG) (defalias 'ses-yank-cells #[514 "\303\304\305#\303GS\305#\205$\211\205$@9\205@\306N\211\307=\2030\2051\310@\"\2021\211\262\262\211@9\205?\211@\306N\211\307=\203Q\205R\310@\"\202R\211\262\262\311@@\312#\311AA\312#\313\"\211@@ZAAZ\304\314\211\211\315 ;\203\206\316\304#\262\211\304\211W\203\211\211\f@\\\262\f\304\211W\203\336\211\211A\\\262\n\303\f\305#\262\317\f\305#\262\f@9\205\305@\306N\211\307=\203\330\205\331\310@\"\202\331\211\262\262 \204\374\nZ\320\312#B\262 \314\211\211E\262 S\262\f@ ZU\204\f\321\322!\210  Z AW\203A \nZ\nAW\2039\323\f\f\"\210T\262\nT\262 \202\324\fS\"\266@\203\326\3258\262  \fH H\211\325H\262\232\204\241\203x;\204x\242\326=\204x\326 D\262 \n\n\n HH\327\330#\211\203\237B\211\n\235\203\232\n\210\202\236\211\nB\210\266A@\262 :\204\271\331 \304\211%\262 :\203\315\242\332=\204\315\332 D\262 \333   #\210\210\211T\262\202\231\266\203\374\303 \305#\203\363\321\334!\210\317 \305#\262 T\314\247\203\f@Y\205\335#\266\211T\262\202\210\266\336!\266\337\266\211\207" [ses--named-cell-hashmap ses--cells ses--deferred-write get-text-property 0 ses ses-cell :ses-named gethash - -1 ses-yank-resize nil "Yanking..." make-progress-reporter next-single-property-change + error "Cell row error" ses-clear-cell ses-print-cell 2 ses-safe-printer ses-setter-with-undo (ses-cell--printer . #[514 "\211\211\300I\207" [2] 6 "\n\n(fn NEWVAL CELL)"]) ses-relocate-formula ses-safe-formula ses-cell-set-formula "Missing newline between rows" progress-reporter-do-update progress-reporter-done t] 29 (#$ . 104150)]) #@180 Insert the substring [FROM,TO] of TEXT as the formula for cell ROWCOL (a cons of ROW and COL). Treat plain symbols as strings unless ARG is a list. (fn ROWCOL TEXT FROM TO ARG) (defalias 'ses-yank-one #[1285 "\3001 \301#0\202\210\302B\211A\206GW\203'\303#\262\202L\211@\203H\211@9\203H:\203>\304@D\202C\303#\262\202L\211@\262@A:\203[\305D\262\306#\266\202\207" [(error) read-from-string nil substring quote ses-safe-formula ses-cell-set-formula] 12 (#$ . 106225)]) #@260 If TEXT contains tabs and/or newlines, treat the tabs as column-separators and the newlines as row-separators and insert the text as cell formulas--else return nil. Treat plain symbols as strings unless ARG is a list. Ignore a final newline. (fn TEXT ARG) (defalias 'ses-yank-tsf #[514 "\300\301\"?\206 \302\225GU?\205\315\211GSH\303U\204 \304P\262\305\211C\302\211\306\211\300\301 T#\211\262\203fB\262T\262H\303=\203'\204R\262\202\\U\204\\\307\310!\210\302\262T\262\202'\311\"\262\302\211W\203\271\211\302\211W\203\260\211\312\313@ [\305$\313 A [\305$B A@T@%\210\nA\262 \210\211T\262\202w\266\211T\262\202n\266\314\313@\305#\313A\305#\"\210\315\266\206\207" [string-match "[ \n]" 0 10 "\n" -1 nil error "Inconsistent row lengths" ses-yank-resize ses-yank-one + ses-goto-print t] 21 (#$ . 106738)]) #@214 If this yank will require inserting rows and/or columns, ask for confirmation and then insert them. Result is (row,col) for top left of yank spot, or error signal if user requests cancel. (fn NEEDROWS NEEDCOLS) (defalias 'ses-yank-resize #[514 "\306 \210\203&9\205\307N\211\310=\203 \205!\311 \"\202!\211\262\202)\n\312B\313\211@\\\nZ\262A\\ Z\262\312V\262\312V\262\204M\211\203\242\314\315\316\203\\\315\317 \"\202]\320\203i\203i\321\202j\320\203v\315\322\n\"\202w\320$!\204\200\323\324!\210\203\221\313\212\325\n\312\"\210\326!\210*\211\203\242\327 \f SH SH$\210\207" [ses--curcell ses--named-cell-hashmap ses--numrows ses--numcols ses--col-widths ses--col-printers ses-begin-change ses-cell :ses-named gethash 0 nil y-or-n-p format "Yank will insert %s%s%s. Continue? " "%d rows" "" " and " "%d columns" error "Canceled" ses-goto-print ses-insert-row ses-insert-column] 13 (#$ . 107617)]) #@138 Export values from the current range, with tabs between columns and newlines between rows. Result is placed in kill ring. (fn BEG END) (defalias 'ses-export-tsv #[514 "\300\301!\207" [ses-export-tab nil] 4 (#$ . 108567) "r"]) #@140 Export formulas from the current range, with tabs between columns and newlines between rows. Result is placed in kill ring. (fn BEG END) (defalias 'ses-export-tsf #[514 "\300\301!\207" [ses-export-tab t] 4 (#$ . 108802) "r"]) #@236 Export the current range with tabs between columns and newlines between rows. Result is placed in kill ring. The export is values unless WANT-FORMULAS is non-nil. Newlines and tabs in the export text are escaped. (fn WANT-FORMULAS) (defalias 'ses-export-tab #[257 "\304\305!\210\306\307\211 \211:\203\211@\202\2119\205&\211:\203#\211@\202$\211\310N\211\311=\203A\n\205B\312:\203;@\202<\n\"\202B\211\262:\203NA\202O9\205`:\203]A\202^\310N\211\311=\203{\n\205|\312:\203uA\202v\n\"\202|\211\262@@AAV\204\222V\203\226\313\314!\210\315\316#\317\211W\203M\211\211\\\315\316#\317\211W\203D\211\211 \\\203\313 HH\211\320H\262\202\326 HH\211\317H\262J\262\242\321=\203\346A@\262\203\362\322=\203\365\323\262\242\324=\203 \325B\262A@\262\326!\262\327\330\331#\262B\262\211 W\203.\330B\262\202; W\203;\332B\262\266\211T\262\202\256\266\211T\262\202\234\266 \333\334\237\"\262\335!)\207" [print-escape-newlines ses--curcell ses--named-cell-hashmap ses--cells ses-check-curcell needrange t nil ses-cell :ses-named gethash error "Empty range" - -1 0 1 ses-safe-formula *skip* "" quote "'" ses-prin1 replace-regexp-in-string " " "\\\\t" "\n" apply concat kill-new] 23 (#$ . 109037)]) #@165 List local printers in a help buffer. Can be called either during editing a printer or a formula, or while in the SES buffer. (fn &optional LOCAL-PRINTER-HASHMAP) (defalias 'ses-list-local-printers #[256 "\211\205m\206 p\306\307E\310\311!\"\210\212 \312\211\223\210\313\nB\314 B\315 \316 \317!\211\312\211\320!\321U\203=\322\323!\210\202G\322\324!\210\325\326\"\210r q\210\327 )\262rq\210\330\312\"\262)\331\332!\203h\332\"\202i\211)\266\204,\207" [ses--list-orig-buffer help-window-point-marker temp-buffer-window-setup-hook temp-buffer-window-show-hook help-window-old-frame standard-output help-setup-xref #[514 "\301!\205\211\302!)\207" [ses--list-orig-buffer buffer-live-p ses-list-local-printers] 4 "\n\n(fn LOCAL-PRINTER-HASHMAP BUFFER)"] called-interactively-p interactive nil help-mode-setup help-mode-finish selected-frame help-buffer temp-buffer-window-setup hash-table-count 0 princ "No local printers defined." "List of local printers definitions:\n" maphash #[514 "\301!\210\301\302!\210\303\304!>\204\305\306\307D\"\210\310H!\210\301\311!\207" [cl-struct-ses--locprn-tags princ " as " prin1 type-of signal wrong-type-argument ses--locprn 1 "\n"] 7 "\n\n(fn KEY VAL)"] buffer-string temp-buffer-window-show functionp help-window-setup] 8 (#$ . 110341) (byte-code "\302\303!\203\n\202 \304 \203 \202 \302\305!\203\306\202 \307\310!C\207" [ses--local-printer-hashmap ses--completion-table derived-mode-p ses-mode minibufferp help-mode nil error "Not in a SES buffer"] 2)]) #@159 List named cells in a help buffer. Can be called either during editing a printer or a formula, or while in the SES buffer. (fn &optional NAMED-CELL-HASHMAP) (defalias 'ses-list-named-cells #[256 "\211\205m\206 p\306\307E\310\311!\"\210\212 \312\211\223\210\313\nB\314 B\315 \316 \317!\211\312\211\320!\321U\203=\322\323!\210\202G\322\324!\210\325\326\"\210r q\210\327 )\262rq\210\330\312\"\262)\331\332!\203h\332\"\202i\211)\266\204,\207" [ses--list-orig-buffer help-window-point-marker temp-buffer-window-setup-hook temp-buffer-window-show-hook help-window-old-frame standard-output help-setup-xref #[514 "\301!\205\211\302!)\207" [ses--list-orig-buffer buffer-live-p ses-list-named-cells] 4 "\n\n(fn NAMED-CELL-HASHMAP BUFFER)"] called-interactively-p interactive nil help-mode-setup help-mode-finish selected-frame help-buffer temp-buffer-window-setup hash-table-count 0 princ "No cell was renamed." "List of named cells definitions:\n" maphash #[514 "\300!\210\300\301!\210\302\303@A\"!\210\300\304!\207" [princ " for " prin1 ses-create-cell-symbol "\n"] 6 "\n\n(fn KEY VAL)"] buffer-string temp-buffer-window-show functionp help-window-setup] 8 (#$ . 111879) (byte-code "\302\303!\203\n\202 \304 \203 \202 \302\305!\203\306\202 \307\310!C\207" [ses--named-cell-hashmap ses--completion-table derived-mode-p ses-mode minibufferp help-mode nil error "Not in a SES buffer"] 2)]) #@32 Select the default header row. (defalias 'ses-unset-header-row #[0 "\300\301!\207" [ses-set-header-row 0] 2 (#$ . 113307) nil]) #@268 Set the ROW to display in the header-line. With a numerical prefix arg, use that row. With no prefix arg, use the current row. With a \[universal-argument] prefix arg, prompt the user. The top row is row 1. Selecting row 0 displays the default header row. (fn ROW) (defalias 'ses-set-header-row #[257 "\211\303W\204\f\211V\203\304\305!\210\306 \210 \307\310\301\"\210)\311\312E\nB\210\313 \207" [ses--numrows ses--header-row buffer-undo-list 0 error "Invalid header-row" ses-begin-change nil ses-set-parameter apply ses-set-header-row ses-reset-header-string] 5 (#$ . 113442) (byte-code "\247\203 \2025 9\205 \303N\211\304=\203\"\n\205#\305 \n\"\202#\211\262@T\2032\306\307\"\2023\211\262C\207" [current-prefix-arg ses--curcell ses--named-cell-hashmap ses-cell :ses-named gethash read-number "Header row: "] 4)]) #@46 Mark the entirety of current row as a range. (defalias 'ses-mark-row #[0 "\302\303!\210\242\206\n9\205\242\206\304N\211\305=\203, \205-\306\242\206' \"\202-\211\262@\307 \210\310T\311\"\210\307`\312\313#\210\310\311\"\207" [ses--curcell ses--named-cell-hashmap ses-check-curcell range ses-cell :ses-named gethash push-mark ses-goto-print 0 nil t] 5 (#$ . 114286) nil]) #@49 Mark the entirety of current column as a range. (defalias 'ses-mark-column #[0 "\304\305!\210\242\206\n9\205\242\206\306N\211\307=\203, \205-\310\242\206' \"\202-\211\262A\311\312 \210\313\nS\"\210\314u\210\312`\315\316#\210 HH\211\311H\262J\317=\203Z\211T\262\202C\313\"\207" [ses--curcell ses--named-cell-hashmap ses--numrows ses--cells ses-check-curcell range ses-cell :ses-named gethash 0 push-mark ses-goto-print 1 nil t *skip*] 6 (#$ . 114679) nil]) #@34 Move point to last cell on line. (defalias 'ses-end-of-line #[0 "\305\306\307\"\210\205\271 S\310\2119\20349\205\311N\211\312=\203+\n\205,\313\n\"\202,\211\262@\262\202\226`\314 W\203@@\202BA9\205V`\314 W\203R@\202TA\311N\211\312=\203t\n\205u\313`\314 W\203m@\202oA\n\"\202u\211\262\262\211ASX\203\210\211@\262\202\226\211@T\262 U\203\226\315\262 W\205\267\fHH\211\315H\262J\316=\203\263S\262\202\234\317\"\266\203\207" [ses--curcell ses--numcols ses--named-cell-hashmap ses--numrows ses--cells ses-check-curcell end range nil ses-cell :ses-named gethash mark 0 *skip* ses-goto-print] 7 (#$ . 115166) nil]) #@74 Narrow the buffer so only the print area is visible. Use after \[widen]. (defalias 'ses-renarrow-buffer #[0 "\301\211\207" [ses--deferred-narrow t] 2 (#$ . 115831) nil]) #@107 Sort the range by a specified column. With prefix, sorts in REVERSE order. (fn SORTER &optional REVERSE) (defalias 'ses-sort-column #[513 "\302\303!\210@9\205@\304N\211\305=\203 \205!\306@ \"\202!\211\262A9\205-A\304N\211\305=\203? \205@\306A \"\202@\211\262@A@A\307\211\211\310 \311P!9\205_\310 \311P!\304N\211\305=\203u \205v\306\310 \311P! \"\202v\211\262A\262 \n\203\217\nY\203\217\nX\204\223\312\313!\210\314\315#\316\211W\203\306\211\317\n\\\"\210\320`\321\"\262\322`\"\n\\BB\262\210\211T\262\202\232\266\323\324\"\262 \204\327\237\262\211\203\377\211@\317AT\"\210`\262\317A \"\210\325`\"B\262A\266\202\202\330\210\326 \210\314\315#\316\211W\205/\211\317\n\\\n\"\210\327 \210\330\211A\262\242\307\"\266\211T\262\202\n\266\202\266\207\207" [ses--curcell ses--named-cell-hashmap ses-check-curcell needrange ses-cell :ses-named gethash nil intern "1" error "Invalid sort column" - -1 0 ses-goto-print next-single-property-change cursor-intangible buffer-substring-no-properties sort #[514 "@@\231\207" [] 4 "\n\n(fn X Y)"] ses-copy-region deactivate-mark ses-set-curcell ses-yank-cells] 17 (#$ . 116009) "*sSort column: \nP"]) #@57 Mouse version of `ses-sort-column'. (fn EVENT REVERSE) (defalias 'ses-sort-column-click #[514 "\302!\262\303\211@\262!\210\304!@\262\305\211W\2032 HV\2032\306 H\307#\262\211T\262\202\211Y\203=\310 \202C\311\312!\"\207" [ses--numcols ses--col-widths event-end select-window posn-col-row 0 - 1 ding ses-sort-column ses-column-letter] 7 (#$ . 117238) "*e\nP"]) #@84 Insert into minibuffer the list of cells currently highlighted in the spreadsheet. (defalias 'ses-insert-range #[0 "\302r\303!q\210\304 \210\305\306!\210\307\310 @ AE!A\262)\311\312\237!\313\314#c\207" [minibuffer-scroll-window ses--curcell nil window-buffer ses-command-hook ses-check-curcell needrange macroexpand ses-range substring prin1-to-string 1 -1] 5 (#$ . 117625) "*"]) #@109 Insert "(ses-range x y)" in the minibuffer to represent the currently highlighted range in the spreadsheet. (defalias 'ses-insert-ses-range #[0 "\302r\303!q\210\304 \210\305\306!\210\307\310 @ A#\262)\211c\207" [minibuffer-scroll-window ses--curcell nil window-buffer ses-command-hook ses-check-curcell needrange format "(ses-range %S %S)"] 5 (#$ . 118015) "*"]) #@50 Mouse version of `ses-insert-range'. (fn EVENT) (defalias 'ses-insert-range-click #[257 "\300!\210\301 \207" [mouse-set-point ses-insert-range] 3 (#$ . 118386) "*e"]) #@54 Mouse version of `ses-insert-ses-range'. (fn EVENT) (defalias 'ses-insert-ses-range-click #[257 "\300!\210\301 \207" [mouse-set-point ses-insert-ses-range] 3 (#$ . 118561) "*e"]) #@34 (fn FORMULA OLD-NAME NEW-NAME) (defalias 'ses-replace-name-in-formula #[771 "\211\242\300=\204N9\203=\203N\262\202N:\203N\203N\242\211:\2036\301#\240\210\202F\2119\203F\242=\203F\240\210\210A\262\202\211\207" [quote ses-replace-name-in-formula] 10 (#$ . 118748)]) #@52 Rename current cell. (fn NEW-NAME &optional CELL) (defalias 'ses-rename-cell #[513 "\306!\203\307!\203\310\311!\204%\312!\203%\313\314\315\"!\204%\310\316!\210\317\320!\2032\321H\202<\317\262\322\262\323 \210\2119\205D\211\324N\211\325=\203U \205V\326 \"\202V\211\262\211@A\317\211\211\206i\nHH\262 \321H\262J\262\327\330 !!\262=\204\217\310\331%\210\203\254\232\203\245\332\n\324#\210\202\304\310\333!\210\202\304 \206\264\334\335\336\"\332\n\324\325#\210\337\n #\210\340\nE B\f\235\203\326\f\202\331\fB\341H\211\203+\211@\2119\205\354\211\324N\211\325=\203\375 \205\376\326 \"\202\376\211\262\n@HAH\f\235\203\f\202\fB\211\211\342\343\342H\n#I\266A\266\202\202\336\210\344 \342H!\211\203\201\211@\2119\205@\211\324N\211\325=\203Q \205R\326 \"\202R\211\262\n@HAH\f\235\203e\f\202h\fB\211\211\341\345\n\341H\"BI\266A\266\202\2022\210\346\n!JL\210\211\321\fI\266 L\210\324N\325=\203\250\347!\210\202\254\350!\210\203\264 \212\204\277\351\"\210`\322\352\353\"\354\353$\210)\266)\355 \207" [ses--curcell ses--named-cell-hashmap ses--cells buffer-undo-list ses--deferred-write inhibit-read-only local-variable-p ses-is-cell-sym-p error "Already a cell name" boundp yes-or-no-p format-message "`%S' is already bound outside this buffer, continue? " "Already a bound cell name" nil ses-cell-p 0 t ses-check-curcell ses-cell :ses-named gethash ses-decode-cell-symbol symbol-name "Spreadsheet is broken, both symbols %S and %S refering to cell (%d,%d)" put "Not a valid name for this cell location" make-hash-table :test eq puthash ses-rename-cell 3 1 ses-replace-name-in-formula ses-formula-references delq make-local-variable ses--unbind-cell-name kill-local-variable ses-goto-print next-single-property-change cursor-intangible put-text-property force-mode-line-update] 22 (#$ . 119054) "*SEnter new name: "]) #@184 Refresh printout for all cells which use printer NAME. NAME should be the name of a locally defined printer. Uses the value COMPILED-VALUE for this printer. (fn NAME COMPILED-VALUE) (defalias 'ses-refresh-local-printer #[514 "\303\304\"\210\305\306\211W\205K\211 \306\211W\203B\211\nHH\211\307H\262\211\n=\2039\2044\310\262\311 \210\312\"\210\266\211T\262\202\266\211T\262\202\266\202\207" [ses--numrows ses--numcols ses--cells message "Refreshing cells using printer %S" nil 0 2 t ses-begin-change ses-print-cell] 13 (#$ . 121018)]) #@751 Define a local printer with name NAME and definition DEFINITION. NAME shall be a symbol. Use TAB to complete over existing local printer names. DEFINITION shall be either a string formatter, e.g.: "%.2f" or ("%.2f") for left alignment. or a lambda expression, e.g. for formatting in ISO format dates created with a '(calcFunc-date YEAR MONTH DAY)' formula: (lambda (x) (cond ((null val) "") ((eq (car-safe x) 'date) (let ((calc-format-date '(X YYYY "-" MM "-" DD))) (math-format-date x))) (t (ses-center-span val ?# 'ses-prin1)))) If NAME is already used to name a local printer function, then the current definition is proposed as default value, and the function is redefined. (fn NAME DEFINITION) (defalias 'ses-define-local-printer #[514 "\306\"\211\205\307! >\204\310\311\312D\"\210\211\313H\314\315=\204y\203+\232\204y\203j\316\262\307! >\204A\310\311\312D\"\210\211\313I\266\317\307! >\204[\310\311\312D\"\210\211\320\321 !I\262\"\210\202y\313\262\322\323!\211\262#\210\211\205\343\324\325!\326\327\307! >\204\225\310\311\312 D\"\210\313H!\330\260\212\331\n\307! >\204\261\310\311\312D\"\210\332H\"\210\315\314\316U\203\310`\333 |\210\202\316\334c\210\335u\210\211c\210\313U\205\340\336\332!\210\337\305 T\"+\262\207" [ses--local-printer-hashmap cl-struct-ses--locprn-tags ses--numrows inhibit-read-only buffer-undo-list ses--numlocprn gethash type-of signal wrong-type-argument ses--locprn 1 nil t 0 ses-refresh-local-printer 2 ses-local-printer-compile puthash ses-make-local-printer-info "(ses-local-printer " symbol-name " " prin1-to-string ")" ses-goto-data 3 line-end-position 10 -1 ses-file-format-extend-parameter-list ses-set-parameter] 13 (#$ . 121585) (byte-code "\302\211\211C\303\304\305\306\307\310!\311\"\312\313%\"\210\314\315\242\"\262\316\230\203&\317\320!\210\321!\262\322\"\211\205E\323! >\204B\324\325\326D\"\210\211\327H\330\331\332\"\"\262\266D\207" [ses--local-printer-hashmap cl-struct-ses--locprn-tags nil maphash make-byte-code 514 "\300\301!\300\242B\240\207" vconcat vector [symbol-name] 5 "\n\n(fn KEY VAL)" completing-read "Enter printer name: " "" error "Invalid printer name" intern gethash type-of signal wrong-type-argument ses--locprn 1 ses-read-printer format "Enter definition of printer %S: "] 10)]) #@286 Same as function `ses-define-if-new-local-printer', except that the definition occurs only when the local printer does not already exists. Function `ses-define-if-new-local-printer' is not interactive; it is intended for mode hooks to add local printers automatically. (fn NAME DEF) (defalias 'ses-define-if-new-local-printer #[514 "\301\"?\205\f\302\"\207" [ses--local-printer-hashmap gethash ses-define-local-printer] 5 (#$ . 123975)]) (put 'ses-define-if-new-local-printer 'byte-optimizer 'byte-compile-inline-expand) #@89 Return PRINTER if safe, or the substitute printer `ses-unsafe' otherwise. (fn PRINTER) (defalias 'ses-safe-printer #[257 "\211;\204\"\211\242;\204\"\211\203\"\2119\203\301\"\204\"\302\303\"\203#\207\304\207" [ses--local-printer-hashmap gethash ses-warn-unsafe unsafep-function ses-unsafe] 4 (#$ . 124509)]) #@85 Return FORMULA if safe, or the substitute formula *unsafe* otherwise. (fn FORMULA) (defalias 'ses-safe-formula #[257 "\300\301\"\203\207\302\303DD\207" [ses-warn-unsafe unsafep ses-unsafe quote] 4 (#$ . 124833)]) #@243 Apply CHECKER to FORMULA. If result is non-nil, asks user for confirmation about FORMULA, which might be unsafe. Returns t if formula is safe or user allows execution anyway. Always returns t if `safe-functions' is t. (fn FORMULA CHECKER) (defalias 'ses-warn-unsafe #[514 "\301=\203\301\207\211!\262\211\204\301\207\302\303\304#!\207" [safe-functions t y-or-n-p format "Formula %S\nmight be unsafe %S. Process it? "] 7 (#$ . 125058)]) #@78 Clean by `delq' list X from any occurrence of nil or `*skip*'. (fn &rest X) (defalias 'ses--clean-! #[128 "\300\301\300\302\"\"\207" [delq nil *skip*] 6 (#$ . 125512)]) #@136 Clean list X by replacing by Y any occurrence of nil or `*skip*'. This will change X by making `setcar' on its cons cells. (fn X Y) (defalias 'ses--clean-_ #[514 "\300\203@\262\211\301>\203\240\210A\262\202\266\207" [nil (nil *skip*)] 6 (#$ . 125690)]) #@1691 Expand to a list of cell-symbols for the range going from FROM up to TO. The range automatically expands to include any new row or column inserted into its middle. The SES library code specifically looks for the symbol `ses-range', so don't create an alias for this macro! By passing in REST some flags one can configure the way the range is read and how it is formatted. In the sequel we assume that cells A1, B1, A2 B2 have respective values 1 2 3 and 4. Readout direction is specified by a `>v', `>^', `', `v<', `^>', `^<' flag. For historical reasons, in absence of such a flag, a default direction of `^<' is assumed. This way `(ses-range A1 B2 ^>)' will evaluate to `(1 3 2 4)', while `(ses-range A1 B2 >^)' will evaluate to (3 4 1 2). If the range is one row, then `>' can be used as a shorthand to `>v' or `>^', and `<' to `' or `v<', and `^' to `^>' or `v<'. A `!' flag will remove all cells whose value is nil or `*skip*'. A `_' flag will replace nil or `*skip*' by the value following the `_' flag. If the `_' flag is the last argument, then they are replaced by integer 0. A `*', `*1' or `*2' flag will vectorize the range in the sense of Calc. See info node `(Calc) Top'. Flag `*' will output either a vector or a matrix depending on the number of rows, `*1' will flatten the result to a one row vector, and `*2' will make a matrix whatever the number of rows. Warning: interaction with Calc is experimental and may produce confusing results if you are not aware of Calc data format. Use `math-format-value' as a printer for Calc objects. (fn FROM TO &rest REST) (defalias 'ses-range '(macro . #[642 "\302\211\303\302\211\211\211\304\n\nB\211:\203\211@\202\2119\205)\211:\203&\211@\202'\211\305N\211\306=\203D\205E\307:\203>@\202?\"\202E\211\262:\203QA\202R9\205c:\203`A\202a\305N\211\306=\203~\205\307:\203xA\202y\"\202\211\262@@AAV\204\225V\203\231\310\311!\210\312\303#\313\211W\203\361\211\211\\\312\303#\313\211W\203\350\211\211 \\U\204\315B\262\302\262 HH\211\313H\262B\262\262\266\211T\262\202\261\266\211T\262\202\237\266 B\262\203\324\211A\262\n\242\211\314\267\202\223\302\262\302\262\302\262\202\320\302\262\302\262\315\262\202\320\302\262\315\262\315\262\202\320\302\262\315\262\302\262\202\320\315\262\302\262\315\262\202\320\315\262\302\262\302\262\202\320\315\262\315\262\302\262\202\320\315\262\315\262\315\262\202\320\211\262\202\320\316\262\202\320\317\320\321\322 \203\213 \211A\262\242\202\214\313EE\262\202\320AA\204\257\211\323>\203\257\324\325!\326P!\nB\262\n\202\320@A\204\313\211\327>\203\313\324\325!\330P!\nB\262\n\202\320\310\331\"\210\210\202\372\203\343\332\333\"\302\241\210\202\351\237A\262\204\364\334\335\"\262\2033\334\336\211A\262\n\242\"\302\203.\262\211A\262\n\242\211\203*\211@@B\240\210A\262A\266\202\202\210\202\262 \266\337\340\204C\341\342 \"B\202l\343\267\202k\n\"\202l\211\n\"\202lA\203c\211\202d\n\"\202l\302\266\202\207" [ses--named-cell-hashmap ses--cells nil -1 list ses-cell :ses-named gethash error "Empty range" - 0 #s(hash-table size 13 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (>v 268 >^ 280 <^ 292 316 ^> 328 ^< 340 v< 352 *1 364 *2 364 * 364 ! 370 _ 376)) t ses--clean-! lambda (&rest x) ses--clean-_ x (> <) intern symbol-name "v" (v ^) ">" "Unexpected flag `%S' in ses-range" last 2 mapcar nreverse #[257 "\211C\207" [] 2 "\n\n(fn X)"] #[514 "\300\301\302\"BB\207" ['vec apply append] 7 "\n\n(fn CLEAN RESULT)"] #[514 "\300\301\302\303\304\305\306 !\307\"\310\311%\"BB\207" ['vec mapcar make-byte-code 257 "\300\301BB\207" vconcat vector ['vec] 4 "\n\n(fn X)"] 11 "\n\n(fn CLEAN RESULT)"] apply append #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (*1 585 *2 593 * 601))] 29 (#$ . 125970)])) #@90 Return ARGS reversed, with the blank elements (nil and *skip*) removed. (fn &rest ARGS) (defalias 'ses-delete-blanks #[128 "\300\211\203\211@\211\301>\204\211B\262A\266\202\202\210\211\207" [nil (nil *skip*)] 6 (#$ . 130050)]) #@69 Compute the sum of the arguments, ignoring blanks. (fn &rest ARGS) (defalias 'ses+ #[128 "\300\301\300\302\"\"\207" [apply + ses-delete-blanks] 6 (#$ . 130294)]) #@164 Computes the sum of the numbers in LIST, divided by their length. Blanks are ignored. Result is always floating-point, even if all args are integers. (fn LIST) (defalias 'ses-average #[257 "\300\301\"\262\302\300\303\"!G\245\207" [apply ses-delete-blanks float +] 5 (#$ . 130465)]) #@273 Select cells in FROMRANGE that are `equal' to TEST. For each match, return the corresponding cell from TORANGE. The ranges are macroexpanded but not evaluated so they should be either (ses-range BEG END) or (list ...). The TEST is evaluated. (fn FROMRANGE TEST TORANGE) (defalias 'ses-select '(macro . #[771 "\300!A\262\300!A\262\301\302\"\262GGU\204\303\304!\210\305\211\203>\211@J\232\2033@B\262A\262A\266\202\202 \210\306B\207" [macroexpand eval t error "ses-select: Ranges not same length" nil list] 8 (#$ . 130761)])) (byte-code "\300\211\203\211@\301\302\303#\210A\266\202\202\207" [(ses-cell-value ses-range ses-delete-blanks ses+ ses-average ses-select) put side-effect-free t] 6) #@380 Print VALUE, centered within column. FILL is the fill character for centering (default = space). SPAN indicates how many additional rightward columns to include in width (default = 0). PRINTER is the printer to use for printing the value, default is the column printer if any, or the spreadsheet the spreadsheet default printer otherwise. (fn VALUE &optional SPAN FILL PRINTER) (defalias 'ses-center #[1025 "\211\206  H\206 \n\262 H\304\204\305\262\204\306\262\307\"\262\306\211W\203G\211\310\311 \310  [#H#\262\210\211T\262\202(\266\312!Z\262\306X\203[\202t\313\314\245\"\262\211\314\246\306V\205s\315!R\207" [ses--col-printers ses--col ses--default-printer ses--col-widths nil 32 0 ses-call-printer + 1 string-width make-string 2 char-to-string] 17 (#$ . 131488)]) #@207 Print VALUE, centered within the span that starts in the current column and continues until the next nonblank column. FILL specifies the fill character (default = space). (fn VALUE &optional FILL PRINTER) (defalias 'ses-center-span #[769 "T\211 W\203\n HH\211\304H\262J\305>\203\211T\262\202\306\307\310#$\207" [ses--col ses--numcols ses--cells ses--row 0 (nil *skip*) ses-center - 1] 10 (#$ . 132309)]) #@148 Print VALUE centered using dashes. SPAN indicates how many rightward columns to include in width (default = 0). (fn VALUE &optional SPAN PRINTER) (defalias 'ses-dashfill #[769 "\300\301$\207" [ses-center 45] 8 (#$ . 132736)]) #@162 Print VALUE, centered using dashes within the span that starts in the current column and continues until the next nonblank column. (fn VALUE &optional PRINTER) (defalias 'ses-dashfill-span #[513 "\300\301#\207" [ses-center-span 45] 6 (#$ . 132973)]) #@162 Print VALUE, centered using tildes within the span that starts in the current column and continues until the next nonblank column. (fn VALUE &optional PRINTER) (defalias 'ses-tildefill-span #[513 "\300\301#\207" [ses-center-span 126] 6 (#$ . 133233)]) #@137 Shorthand for '(prin1-to-string VALUE t)'. Useful to handle the default behavior in custom lambda based printer functions. (fn VALUE) (defalias 'ses-prin1 #[257 "\300\301\"\207" [prin1-to-string t] 4 (#$ . 133495)]) #@58 Substitute for an unsafe formula or printer. (fn VALUE) (defalias 'ses-unsafe #[257 "\300\301!\207" [error "Unsafe formula or printer"] 3 (#$ . 133720)]) (byte-code "\301B\211\203\211@\302\303\304#\210A\266\202\202\207" [ses-standard-printer-functions ses-unsafe put side-effect-free t] 6) #@38 Unload the Simple Emacs Spreadsheet. (defalias 'ses-unload-function #[0 "\300\301\302\"\210\300\303\304\"\210\305\207" [advice-remove yank ses--advice-yank copy-region-as-kill ses--advice-copy-region-as-kill nil] 3 (#$ . 134024)]) (provide 'ses)