From 7c018923b03fb5907df95a72336ca535f1f6b4e0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 Jan 2005 23:46:31 +0000 Subject: [PATCH] (ses-dotimes-msg): Remove macro. Use `dotimes-with-progress-reporter' instead. --- lisp/ChangeLog | 12 ++++++++++-- lisp/ses.el | 47 ++++++++++++++++------------------------------- 2 files changed, 26 insertions(+), 33 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f7eb4f9749c..05a6915355f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2005-01-10 Paul Pogonyshev + + * subr.el (dotimes-with-progress-reporter): New macro. + + * ses.el (ses-dotimes-msg): Remove macro. + Use `dotimes-with-progress-reporter' instead. + 2005-01-19 Steven Tamm * term/mac-win.el (process-connection-type): Use new @@ -34,6 +41,8 @@ 2005-01-18 Stefan Monnier + * simple.el (blink-matching-open): Strip extra info from syntax. + * progmodes/sh-script.el (sh-here-doc-open-re): Don't allow | or other funny chars in the end-of-here-doc marker. @@ -6362,8 +6371,7 @@ * progmodes/cperl-mode.el (cperl-mode): Adapt defun-prompt-regexp so that it is more understanding of whitespace. - * xml.el (xml-maybe-do-ns, xml-parse-tag): Produce elements in the - form + * xml.el (xml-maybe-do-ns, xml-parse-tag): Produce elements in the form (("ns" . "element") (attr-list) children) instead of ((:ns . "element") (attr-list) children) in order to reduce the number of symbols used. diff --git a/lisp/ses.el b/lisp/ses.el index 2a952aab286..49d4f49d94a 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -405,26 +405,6 @@ for safety. This is a macro to prevent propagate-on-load viruses." (setq ses--header-row row) t) -(defmacro ses-dotimes-msg (spec msg &rest body) - "(ses-dotimes-msg (VAR LIMIT) MSG BODY...): Like `dotimes', but -a message is emitted using MSG every second or so during the loop." - (let ((msgvar (make-symbol "msg")) - (limitvar (make-symbol "limit")) - (var (car spec)) - (limit (cadr spec))) - `(let ((,limitvar ,limit) - (,msgvar ,msg)) - (setq ses-start-time (float-time)) - (message ,msgvar) - (setq ,msgvar (concat ,msgvar " (%d%%)")) - (dotimes (,var ,limitvar) - (ses-time-check ,msgvar '(/ (* ,var 100) ,limitvar)) - ,@body) - (message nil)))) - -(put 'ses-dotimes-msg 'lisp-indent-function 2) -(def-edebug-spec ses-dotimes-msg ((symbolp form) form body)) - (defmacro ses-dorange (curcell &rest body) "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 @@ -1218,7 +1198,8 @@ the rectangle (MINROW,MINCOL)..(NUMROWS,NUMCOLS) by adding ROWINCR and COLINCR to each symbol." (let (reform) (let (mycell newval) - (ses-dotimes-msg (row ses--numrows) "Relocating formulas..." + (dotimes-with-progress-reporter + (row ses--numrows) "Relocating formulas..." (dotimes (col ses--numcols) (setq ses-relocate-return nil mycell (ses-get-cell row col) @@ -1246,7 +1227,8 @@ to each symbol." (cond ((and (<= rowincr 0) (<= colincr 0)) ;;Deletion of rows and/or columns - (ses-dotimes-msg (row (- ses--numrows minrow)) "Relocating variables..." + (dotimes-with-progress-reporter + (row (- ses--numrows minrow)) "Relocating variables..." (setq myrow (+ row minrow)) (dotimes (col (- ses--numcols mincol)) (setq mycol (+ col mincol) @@ -1262,7 +1244,8 @@ to each symbol." (let ((disty (1- ses--numrows)) (distx (1- ses--numcols)) myrow mycol) - (ses-dotimes-msg (row (- ses--numrows minrow)) "Relocating variables..." + (dotimes-with-progress-reporter + (row (- ses--numrows minrow)) "Relocating variables..." (setq myrow (- disty row)) (dotimes (col (- ses--numcols mincol)) (setq mycol (- distx col) @@ -1475,7 +1458,7 @@ Narrows the buffer to show only the print area. Gives it `read-only' and (put-text-property (point-min) (1+ (point-min)) 'front-sticky t) ;;Create intangible properties, which also indicate which cell the text ;;came from. - (ses-dotimes-msg (row ses--numrows) "Finding cells..." + (dotimes-with-progress-reporter (row ses--numrows) "Finding cells..." (dotimes (col ses--numcols) (setq pos end sym (ses-cell-symbol row col)) @@ -1724,7 +1707,7 @@ print area if NONARROW is nil." ;;find the data area when inserting or deleting *skip* values for cells (dotimes (row ses--numrows) (insert-and-inherit ses--blank-line)) - (ses-dotimes-msg (row ses--numrows) "Reprinting..." + (dotimes-with-progress-reporter (row ses--numrows) "Reprinting..." (if (eq (ses-cell-value row 0) '*skip*) ;;Column deletion left a dangling skip (ses-set-cell row 0 'value nil)) @@ -1809,11 +1792,13 @@ cells." ;;Reconstruct reference lists. (let (x yrow ycol) ;;Delete old reference lists - (ses-dotimes-msg (row ses--numrows) "Deleting references..." + (dotimes-with-progress-reporter + (row ses--numrows) "Deleting references..." (dotimes (col ses--numcols) (ses-set-cell row col 'references nil))) ;;Create new reference lists - (ses-dotimes-msg (row ses--numrows) "Computing references..." + (dotimes-with-progress-reporter + (row ses--numrows) "Computing references..." (dotimes (col ses--numcols) (dolist (ref (ses-formula-references (ses-cell-formula row col))) (setq x (ses-sym-rowcol ref) @@ -2073,7 +2058,7 @@ before current one." (ses-set-parameter 'ses--numrows (+ ses--numrows count)) ;;Insert each row (ses-goto-print row 0) - (ses-dotimes-msg (x count) "Inserting row..." + (dotimes-with-progress-reporter (x count) "Inserting row..." ;;Create a row of empty cells. The `symbol' fields will be set by ;;the call to ses-relocate-all. (setq newrow (make-vector ses--numcols nil)) @@ -2162,7 +2147,7 @@ If COL is specified, the new column(s) get the specified WIDTH and PRINTER (ses-create-cell-variable-range 0 (1- ses--numrows) ses--numcols (+ ses--numcols count -1)) ;;Insert each column. - (ses-dotimes-msg (x count) "Inserting column..." + (dotimes-with-progress-reporter (x count) "Inserting column..." ;;Create a column of empty cells. The `symbol' fields will be set by ;;the call to ses-relocate-all. (ses-adjust-print-width col (1+ width)) @@ -2220,7 +2205,7 @@ from the current one." (ses-begin-change) (ses-set-parameter 'ses--numcols (- ses--numcols count)) (ses-adjust-print-width col (- width)) - (ses-dotimes-msg (row ses--numrows) "Deleting column..." + (dotimes-with-progress-reporter (row ses--numrows) "Deleting column..." ;;Delete lines from cell data area (ses-goto-data row col) (ses-delete-line count) @@ -2469,7 +2454,7 @@ formulas are to be inserted without relocation." (colincr (- (cdr rowcol) (cdr first))) (pos 0) myrow mycol x) - (ses-dotimes-msg (row needrows) "Yanking..." + (dotimes-with-progress-reporter (row needrows) "Yanking..." (setq myrow (+ row (car rowcol))) (dotimes (col needcols) (setq mycol (+ col (cdr rowcol)) -- 2.39.2