Mercurial > emacs
comparison lisp/ses.el @ 83542:2d56e13fd23d
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-413
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-414
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-415
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-416
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-417
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-418
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-419
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-420
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-421
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-422
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-423
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-424
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-425
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-426
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-427
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-428
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-429
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-430
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-431
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-432
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-433
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-434
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-435
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-436
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-437
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-438
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-439
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-440
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-441
lisp/url/url-methods.el: Fix format error when http_proxy is empty string
* emacs@sv.gnu.org/emacs--devo--0--patch-442
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-443
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-444
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-445
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-446
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-447
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-448
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-449
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-450
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-451
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-452
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-453
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-454
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-455
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-456
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-457
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-458
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-459
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-460
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-461
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-462
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-463
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-464
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-465
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-466
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-467
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-468
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-469
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-470
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-471
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-472
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-473
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-128
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-129
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-130
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-131
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-132
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-133
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-134
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-135
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-136
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-137
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-138
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-139
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-140
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-141
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-142
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-143
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-144
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-145
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-146
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-147
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-148
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-149
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-582
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 14 Oct 2006 17:36:28 +0000 |
parents | 78e299b7e214 |
children | 3f47174be57e bb0e318b7c53 |
comparison
equal
deleted
inserted
replaced
83541:694bbb62a75d | 83542:2d56e13fd23d |
---|---|
235 "(ses-header-row 0)\n" | 235 "(ses-header-row 0)\n" |
236 ses-initial-global-parameters | 236 ses-initial-global-parameters |
237 ses-initial-file-trailer) | 237 ses-initial-file-trailer) |
238 "The initial contents of an empty spreadsheet.") | 238 "The initial contents of an empty spreadsheet.") |
239 | 239 |
240 (defconst ses-paramlines-plist | |
241 '(ses--col-widths 2 ses--col-printers 3 ses--default-printer 4 | |
242 ses--header-row 5 ses--file-format 8 ses--numrows 9 | |
243 ses--numcols 10) | |
244 "Offsets from last cell line to various parameter lines in the data area | |
245 of a spreadsheet.") | |
246 | |
247 (defconst ses-box-prop '(:box (:line-width 2 :style released-button)) | 240 (defconst ses-box-prop '(:box (:line-width 2 :style released-button)) |
248 "Display properties to create a raised box for cells in the header line.") | 241 "Display properties to create a raised box for cells in the header line.") |
249 | 242 |
250 (defconst ses-standard-printer-functions | 243 (defconst ses-standard-printer-functions |
251 '(ses-center ses-center-span ses-dashfill ses-dashfill-span | 244 '(ses-center ses-center-span ses-dashfill ses-dashfill-span |
253 "List of print functions to be included in initial history of printer | 246 "List of print functions to be included in initial history of printer |
254 functions. None of these standard-printer functions is suitable for use as a | 247 functions. None of these standard-printer functions is suitable for use as a |
255 column printer or a global-default printer because they invoke the column or | 248 column printer or a global-default printer because they invoke the column or |
256 default printer and then modify its output.") | 249 default printer and then modify its output.") |
257 | 250 |
251 | |
252 ;;---------------------------------------------------------------------------- | |
253 ;; Local variables and constants | |
254 ;;---------------------------------------------------------------------------- | |
255 | |
258 (eval-and-compile | 256 (eval-and-compile |
259 (defconst ses-localvars | 257 (defconst ses-localvars |
260 '(ses--blank-line ses--cells ses--col-printers ses--col-widths ses--curcell | 258 '(ses--blank-line ses--cells ses--col-printers ses--col-widths ses--curcell |
261 ses--curcell-overlay ses--default-printer ses--deferred-narrow | 259 ses--curcell-overlay ses--default-printer ses--deferred-narrow |
262 ses--deferred-recalc ses--deferred-write ses--file-format | 260 ses--deferred-recalc ses--deferred-write ses--file-format |
263 ses--header-hscroll ses--header-row ses--header-string ses--linewidth | 261 ses--header-hscroll ses--header-row ses--header-string ses--linewidth |
264 ses--numcols ses--numrows ses--symbolic-formulas | 262 ses--numcols ses--numrows ses--symbolic-formulas ses--data-marker |
263 ses--params-marker | |
265 ;;Global variables that we override | 264 ;;Global variables that we override |
266 mode-line-process next-line-add-newlines transient-mark-mode) | 265 mode-line-process next-line-add-newlines transient-mark-mode) |
267 "Buffer-local variables used by SES.")) | 266 "Buffer-local variables used by SES.")) |
268 | 267 |
269 ;;When compiling, create all the buffer locals and give them values | 268 ;;When compiling, create all the buffer locals and give them values |
270 (eval-when-compile | 269 (eval-when-compile |
271 (dolist (x ses-localvars) | 270 (dolist (x ses-localvars) |
272 (make-local-variable x) | 271 (make-local-variable x) |
273 (set x nil))) | 272 (set x nil))) |
273 | |
274 (defconst ses-paramlines-plist | |
275 '(ses--col-widths -5 ses--col-printers -4 ses--default-printer -3 | |
276 ses--header-row -2 ses--file-format 1 ses--numrows 2 | |
277 ses--numcols 3) | |
278 "Offsets from 'Global parameters' line to various parameter lines in the | |
279 data area of a spreadsheet.") | |
274 | 280 |
275 | 281 |
276 ;; | 282 ;; |
277 ;; "Side-effect variables". They are set in one function, altered in | 283 ;; "Side-effect variables". They are set in one function, altered in |
278 ;; another as a side effect, then read back by the first, as a way of | 284 ;; another as a side effect, then read back by the first, as a way of |
406 | 412 |
407 (defmacro ses-dorange (curcell &rest body) | 413 (defmacro ses-dorange (curcell &rest body) |
408 "Execute BODY repeatedly, with the variables `row' and `col' set to each | 414 "Execute BODY repeatedly, with the variables `row' and `col' set to each |
409 cell in the range specified by CURCELL. The range is available in the | 415 cell in the range specified by CURCELL. The range is available in the |
410 variables `minrow', `maxrow', `mincol', and `maxcol'." | 416 variables `minrow', `maxrow', `mincol', and `maxcol'." |
417 (declare (indent defun) (debug (form body))) | |
411 (let ((cur (make-symbol "cur")) | 418 (let ((cur (make-symbol "cur")) |
412 (min (make-symbol "min")) | 419 (min (make-symbol "min")) |
413 (max (make-symbol "max")) | 420 (max (make-symbol "max")) |
414 (r (make-symbol "r")) | 421 (r (make-symbol "r")) |
415 (c (make-symbol "c"))) | 422 (c (make-symbol "c"))) |
426 (dotimes (,r (- maxrow minrow -1)) | 433 (dotimes (,r (- maxrow minrow -1)) |
427 (setq row (+ ,r minrow)) | 434 (setq row (+ ,r minrow)) |
428 (dotimes (,c (- maxcol mincol -1)) | 435 (dotimes (,c (- maxcol mincol -1)) |
429 (setq col (+ ,c mincol)) | 436 (setq col (+ ,c mincol)) |
430 ,@body)))))) | 437 ,@body)))))) |
431 | |
432 (put 'ses-dorange 'lisp-indent-function 'defun) | |
433 (def-edebug-spec ses-dorange (form body)) | |
434 | 438 |
435 ;;Support for coverage testing. | 439 ;;Support for coverage testing. |
436 (defmacro 1value (form) | 440 (defmacro 1value (form) |
437 "For code-coverage testing, indicate that FORM is expected to always have | 441 "For code-coverage testing, indicate that FORM is expected to always have |
438 the same value." | 442 the same value." |
648 (ses-cell-set-formula row col nil)) | 652 (ses-cell-set-formula row col nil)) |
649 | 653 |
650 (defun ses-update-cells (list &optional force) | 654 (defun ses-update-cells (list &optional force) |
651 "Recalculate cells in LIST, checking for dependency loops. Prints | 655 "Recalculate cells in LIST, checking for dependency loops. Prints |
652 progress messages every second. Dependent cells are not recalculated | 656 progress messages every second. Dependent cells are not recalculated |
653 if the cell's value is unchanged if FORCE is nil." | 657 if the cell's value is unchanged and FORCE is nil." |
654 (let ((ses--deferred-recalc list) | 658 (let ((ses--deferred-recalc list) |
655 (nextlist list) | 659 (nextlist list) |
656 (pos (point)) | 660 (pos (point)) |
657 curlist prevlist rowcol formula) | 661 curlist prevlist rowcol formula) |
658 (with-temp-message " " | 662 (with-temp-message " " |
707 ;; The print area | 711 ;; The print area |
708 ;;---------------------------------------------------------------------------- | 712 ;;---------------------------------------------------------------------------- |
709 | 713 |
710 (defun ses-in-print-area () | 714 (defun ses-in-print-area () |
711 "Returns t if point is in print area of spreadsheet." | 715 "Returns t if point is in print area of spreadsheet." |
712 (eq (get-text-property (point) 'keymap) 'ses-mode-print-map)) | 716 (<= (point) ses--data-marker)) |
713 | 717 |
714 ;;We turn off point-motion-hooks and explicitly position the cursor, in case | 718 ;;We turn off point-motion-hooks and explicitly position the cursor, in case |
715 ;;the intangible properties have gotten screwed up (e.g., when | 719 ;;the intangible properties have gotten screwed up (e.g., when |
716 ;;ses-goto-print is called during a recursive ses-print-cell). | 720 ;;ses-goto-print is called during a recursive ses-print-cell). |
717 (defun ses-goto-print (row col) | 721 (defun ses-goto-print (row col) |
951 number, COL is the column number for a data cell -- otherwise DEF | 955 number, COL is the column number for a data cell -- otherwise DEF |
952 is one of the symbols ses--col-widths, ses--col-printers, | 956 is one of the symbols ses--col-widths, ses--col-printers, |
953 ses--default-printer, ses--numrows, or ses--numcols." | 957 ses--default-printer, ses--numrows, or ses--numcols." |
954 (ses-widen) | 958 (ses-widen) |
955 (let ((inhibit-point-motion-hooks t)) ;In case intangible attrs are wrong | 959 (let ((inhibit-point-motion-hooks t)) ;In case intangible attrs are wrong |
956 (goto-char (point-min)) | |
957 (if col | 960 (if col |
958 ;;It's a cell | 961 ;;It's a cell |
959 (forward-line (+ ses--numrows 2 (* def (1+ ses--numcols)) col)) | 962 (progn |
960 ;;Convert def-symbol to offset | 963 (goto-char ses--data-marker) |
961 (setq def (plist-get ses-paramlines-plist def)) | 964 (forward-line (+ 1 (* def (1+ ses--numcols)) col))) |
962 (or def (signal 'args-out-of-range nil)) | 965 ;;Convert def-symbol to offset |
963 (forward-line (+ (* ses--numrows (+ ses--numcols 2)) def))))) | 966 (setq def (plist-get ses-paramlines-plist def)) |
967 (or def (signal 'args-out-of-range nil)) | |
968 (goto-char ses--params-marker) | |
969 (forward-line def)))) | |
964 | 970 |
965 (defun ses-set-parameter (def value &optional elem) | 971 (defun ses-set-parameter (def value &optional elem) |
966 "Set parameter DEF to VALUE (with undo) and write the value to the data area. | 972 "Set parameter DEF to VALUE (with undo) and write the value to the data area. |
967 See `ses-goto-data' for meaning of DEF. Newlines in the data are escaped. | 973 See `ses-goto-data' for meaning of DEF. Newlines in the data are escaped. |
968 If ELEM is specified, it is the array subscript within DEF to be set to VALUE." | 974 If ELEM is specified, it is the array subscript within DEF to be set to VALUE." |
1068 (t | 1074 (t |
1069 ;;Ignore other stuff | 1075 ;;Ignore other stuff |
1070 )))) | 1076 )))) |
1071 result-so-far) | 1077 result-so-far) |
1072 | 1078 |
1079 (defsubst ses-relocate-symbol (sym rowcol startrow startcol rowincr colincr) | |
1080 "Relocate one symbol SYM, whichs corresponds to ROWCOL (a cons of ROW and | |
1081 COL). Cells starting at (STARTROW,STARTCOL) are being shifted | |
1082 by (ROWINCR,COLINCR)." | |
1083 (let ((row (car rowcol)) | |
1084 (col (cdr rowcol))) | |
1085 (if (or (< row startrow) (< col startcol)) | |
1086 sym | |
1087 (setq row (+ row rowincr) | |
1088 col (+ col colincr)) | |
1089 (if (and (>= row startrow) (>= col startcol) | |
1090 (< row ses--numrows) (< col ses--numcols)) | |
1091 ;;Relocate this variable | |
1092 (ses-create-cell-symbol row col) | |
1093 ;;Delete reference to a deleted cell | |
1094 nil)))) | |
1095 | |
1073 (defun ses-relocate-formula (formula startrow startcol rowincr colincr) | 1096 (defun ses-relocate-formula (formula startrow startcol rowincr colincr) |
1074 "Produce a copy of FORMULA where all symbols that refer to cells in row | 1097 "Produce a copy of FORMULA where all symbols that refer to cells in row |
1075 STARTROW or above and col STARTCOL or above are altered by adding ROWINCR | 1098 STARTROW or above and col STARTCOL or above are altered by adding ROWINCR |
1076 and COLINCR. STARTROW and STARTCOL are 0-based. Example: | 1099 and COLINCR. STARTROW and STARTCOL are 0-based. Example: |
1077 (ses-relocate-formula '(+ A1 B2 D3) 1 2 1 -1) | 1100 (ses-relocate-formula '(+ A1 B2 D3) 1 2 1 -1) |
1111 ;;Recursively copy and alter subformulas | 1134 ;;Recursively copy and alter subformulas |
1112 (push (ses-relocate-formula cur startrow startcol | 1135 (push (ses-relocate-formula cur startrow startcol |
1113 rowincr colincr) | 1136 rowincr colincr) |
1114 result)))) | 1137 result)))) |
1115 (nreverse result)))) | 1138 (nreverse result)))) |
1116 | |
1117 (defun ses-relocate-symbol (sym rowcol startrow startcol rowincr colincr) | |
1118 "Relocate one symbol SYM, whichs corresponds to ROWCOL (a cons of ROW and | |
1119 COL). Cells starting at (STARTROW,STARTCOL) are being shifted | |
1120 by (ROWINCR,COLINCR)." | |
1121 (let ((row (car rowcol)) | |
1122 (col (cdr rowcol))) | |
1123 (if (or (< row startrow) (< col startcol)) | |
1124 sym | |
1125 (setq row (+ row rowincr) | |
1126 col (+ col colincr)) | |
1127 (if (and (>= row startrow) (>= col startcol) | |
1128 (< row ses--numrows) (< col ses--numcols)) | |
1129 ;;Relocate this variable | |
1130 (ses-create-cell-symbol row col) | |
1131 ;;Delete reference to a deleted cell | |
1132 nil)))) | |
1133 | 1139 |
1134 (defun ses-relocate-range (range startrow startcol rowincr colincr) | 1140 (defun ses-relocate-range (range startrow startcol rowincr colincr) |
1135 "Relocate one RANGE, of the form '(ses-range min max). Cells starting | 1141 "Relocate one RANGE, of the form '(ses-range min max). Cells starting |
1136 at (STARTROW,STARTCOL) are being shifted by (ROWINCR,COLINCR). Result is the | 1142 at (STARTROW,STARTCOL) are being shifted by (ROWINCR,COLINCR). Result is the |
1137 new range, or nil if the entire range is deleted. If new rows are being added | 1143 new range, or nil if the entire range is deleted. If new rows are being added |
1335 (widen) | 1341 (widen) |
1336 ;;Read our global parameters, which should be a 3-element list | 1342 ;;Read our global parameters, which should be a 3-element list |
1337 (goto-char (point-max)) | 1343 (goto-char (point-max)) |
1338 (search-backward ";; Local Variables:\n" nil t) | 1344 (search-backward ";; Local Variables:\n" nil t) |
1339 (backward-list 1) | 1345 (backward-list 1) |
1346 (setq ses--params-marker (point-marker)) | |
1340 (let ((params (condition-case nil (read (current-buffer)) (error nil)))) | 1347 (let ((params (condition-case nil (read (current-buffer)) (error nil)))) |
1341 (or (and (= (safe-length params) 3) | 1348 (or (and (= (safe-length params) 3) |
1342 (numberp (car params)) | 1349 (numberp (car params)) |
1343 (numberp (cadr params)) | 1350 (numberp (cadr params)) |
1344 (>= (cadr params) 0) | 1351 (>= (cadr params) 0) |
1364 ;;Skip over print area, which we assume is correct | 1371 ;;Skip over print area, which we assume is correct |
1365 (goto-char (point-min)) | 1372 (goto-char (point-min)) |
1366 (forward-line ses--numrows) | 1373 (forward-line ses--numrows) |
1367 (or (looking-at ses-print-data-boundary) | 1374 (or (looking-at ses-print-data-boundary) |
1368 (error "Missing marker between print and data areas")) | 1375 (error "Missing marker between print and data areas")) |
1369 (forward-char (length ses-print-data-boundary)) | 1376 (forward-char 1) |
1377 (setq ses--data-marker (point-marker)) | |
1378 (forward-char (1- (length ses-print-data-boundary))) | |
1370 ;;Initialize printer and symbol lists | 1379 ;;Initialize printer and symbol lists |
1371 (mapc 'ses-printer-record ses-standard-printer-functions) | 1380 (mapc 'ses-printer-record ses-standard-printer-functions) |
1372 (setq ses--symbolic-formulas nil) | 1381 (setq ses--symbolic-formulas nil) |
1373 ;;Load cell definitions | 1382 ;;Load cell definitions |
1374 (dotimes (row ses--numrows) | 1383 (dotimes (row ses--numrows) |
1571 (push '(apply ses-widen) buffer-undo-list)) | 1580 (push '(apply ses-widen) buffer-undo-list)) |
1572 (when ses--deferred-narrow | 1581 (when ses--deferred-narrow |
1573 ;;We're not allowed to narrow the buffer until after-find-file has | 1582 ;;We're not allowed to narrow the buffer until after-find-file has |
1574 ;;read the local variables at the end of the file. Now it's safe to | 1583 ;;read the local variables at the end of the file. Now it's safe to |
1575 ;;do the narrowing. | 1584 ;;do the narrowing. |
1576 (save-excursion | 1585 (narrow-to-region (point-min) ses--data-marker) |
1577 (goto-char (point-min)) | |
1578 (forward-line ses--numrows) | |
1579 (narrow-to-region (point-min) (point))) | |
1580 (setq ses--deferred-narrow nil)) | 1586 (setq ses--deferred-narrow nil)) |
1581 ;;Update the modeline | 1587 ;;Update the modeline |
1582 (let ((oldcell ses--curcell)) | 1588 (let ((oldcell ses--curcell)) |
1583 (ses-set-curcell) | 1589 (ses-set-curcell) |
1584 (unless (eq ses--curcell oldcell) | 1590 (unless (eq ses--curcell oldcell) |
1801 (goto-char (point-min))) | 1807 (goto-char (point-min))) |
1802 ;;Create a blank display area | 1808 ;;Create a blank display area |
1803 (dotimes (row ses--numrows) | 1809 (dotimes (row ses--numrows) |
1804 (insert ses--blank-line)) | 1810 (insert ses--blank-line)) |
1805 (insert ses-print-data-boundary) | 1811 (insert ses-print-data-boundary) |
1812 (backward-char (1- (length ses-print-data-boundary))) | |
1813 (setq ses--data-marker (point-marker)) | |
1814 (forward-char (1- (length ses-print-data-boundary))) | |
1806 ;;Placeholders for cell data | 1815 ;;Placeholders for cell data |
1807 (insert (make-string (* ses--numrows (1+ ses--numcols)) ?\n)) | 1816 (insert (make-string (* ses--numrows (1+ ses--numcols)) ?\n)) |
1808 ;;Placeholders for col-widths, col-printers, default-printer, header-row | 1817 ;;Placeholders for col-widths, col-printers, default-printer, header-row |
1809 (insert "\n\n\n\n") | 1818 (insert "\n\n\n\n") |
1810 (insert ses-initial-global-parameters)) | 1819 (insert ses-initial-global-parameters) |
1820 (backward-char (1- (length ses-initial-global-parameters))) | |
1821 (setq ses--params-marker (point-marker)) | |
1822 (forward-char (1- (length ses-initial-global-parameters)))) | |
1811 (ses-set-parameter 'ses--col-widths ses--col-widths) | 1823 (ses-set-parameter 'ses--col-widths ses--col-widths) |
1812 (ses-set-parameter 'ses--col-printers ses--col-printers) | 1824 (ses-set-parameter 'ses--col-printers ses--col-printers) |
1813 (ses-set-parameter 'ses--default-printer ses--default-printer) | 1825 (ses-set-parameter 'ses--default-printer ses--default-printer) |
1814 (ses-set-parameter 'ses--header-row ses--header-row) | 1826 (ses-set-parameter 'ses--header-row ses--header-row) |
1815 (ses-set-parameter 'ses--numrows ses--numrows) | 1827 (ses-set-parameter 'ses--numrows ses--numrows) |
2878 (push (car torange) result)) | 2890 (push (car torange) result)) |
2879 (setq torange (cdr torange))) | 2891 (setq torange (cdr torange))) |
2880 (cons 'list result))) | 2892 (cons 'list result))) |
2881 | 2893 |
2882 ;;All standard formulas are safe | 2894 ;;All standard formulas are safe |
2883 (dolist (x '(ses-range ses-delete-blanks ses+ ses-average ses-select)) | 2895 (dolist (x '(ses-cell-value ses-range ses-delete-blanks ses+ ses-average |
2896 ses-select)) | |
2884 (put x 'side-effect-free t)) | 2897 (put x 'side-effect-free t)) |
2885 | 2898 |
2886 | 2899 |
2887 ;;---------------------------------------------------------------------------- | 2900 ;;---------------------------------------------------------------------------- |
2888 ;; Standard print functions | 2901 ;; Standard print functions |