[q-lang-cvs] qcalc qcalc.q,1.185,1.186
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-25 12:55:42
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21117 Modified Files: qcalc.q Log Message: bugfixes, optimizations Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.185 retrieving revision 1.186 diff -C2 -d -r1.185 -r1.186 *** qcalc.q 25 Nov 2007 11:31:14 -0000 1.185 --- qcalc.q 25 Nov 2007 12:55:38 -0000 1.186 *************** *** 994,998 **** = false; // From here on we assume that the process is still alive and kicking. ! where S:String = try2 MSGS: // We got some output, digest it and retry. = digest S || startup_loop (H,PID,MASTER); --- 994,998 ---- = false; // From here on we assume that the process is still alive and kicking. ! where S:String = try2 5 MSGS: // We got some output, digest it and retry. = digest S || startup_loop (H,PID,MASTER); *************** *** 1344,1348 **** accept _ _ _ where _ = LAST_EDIT := (), (I,J) = real_current_cell: ! = doprocess (I,J) || digest_loop if is_gui_elem (I,J); = EDITED := true || --- 1344,1350 ---- accept _ _ _ where _ = LAST_EDIT := (), (I,J) = real_current_cell: ! = doprocess (I,J) || digest_loop || ! if qt TABW "currentPageIndex" () = 0 then ! qt TABLE "setFocus" () if is_gui_elem (I,J); = EDITED := true || *************** *** 3562,3566 **** = statusmsg "Interpreter offline? (Check the error log!)" || do flag [(I,J)|V]; ! where S:String = try2 MSGS: // evaluation succeeded, we're good = update_cell (I,J) S || results_loop T0 (delete U (I,J)) V --- 3564,3568 ---- = statusmsg "Interpreter offline? (Check the error log!)" || do flag [(I,J)|V]; ! where S:String = try2 5 MSGS: // evaluation succeeded, we're good = update_cell (I,J) S || results_loop T0 (delete U (I,J)) V *************** *** 3662,3676 **** = results_loop T0 U [(I,J)|V] otherwise; ! /* Note that we try the semaphore *two* times before we give up and hand it over to the GUI, so that we can hopefully avoid the GUI kicking in for most simple calculations which execute almost instantaneously. */ ! try2 SEM = check2 SEM (get SEM) if #SEM>0; ! = sleep 0.1 || check2 SEM (try SEM); ! check2 SEM (formatted S:String) // preformatted string, pass that directly to the digest function ! = local (digest (formatted S)) || try2 SEM; ! check2 SEM S = S otherwise; /* Update a cell value with a computed result. */ --- 3664,3678 ---- = results_loop T0 U [(I,J)|V] otherwise; ! /* Note that we try the semaphore several times before we give up and hand it over to the GUI, so that we can hopefully avoid the GUI kicking in for most simple calculations which execute almost instantaneously. */ ! try2 N SEM = check2 N SEM (get SEM) if #SEM>0; ! = sleep 0.01 || check2 (N-1) SEM (try SEM) if N>0; ! check2 N SEM (formatted S:String) // preformatted string, pass that directly to the digest function ! = local (digest (formatted S)) || try2 N SEM; ! check2 N SEM S = S otherwise; /* Update a cell value with a computed result. */ *************** *** 3856,3860 **** /* Some nice fontification for compiler error and warning messages. */ - //format S = printf "-> '%s'\n" S || fail; format S if eq () (sscanf S "! File"): --- 3858,3861 ---- *************** *** 3914,3923 **** post_msg S = post_msgs $ split "\f" S if pos "\f" S >= 0; = post_msg1 S otherwise; ! post_msg1 S = catch () (post MSGS (format S)); ! post_msgs [S|L] = do (post MSGS) $ filter (neg null) L if null S; ! = post_msg1 S || do (post MSGS) $ filter (neg null) L otherwise; def BUF = ref ""; collect S where S = get BUF++S: --- 3915,3927 ---- post_msg S = post_msgs $ split "\f" S if pos "\f" S >= 0; = post_msg1 S otherwise; ! post_msg1 S = catch () (post MSGS (format (debugmsg S))); ! post_msgs [S|L] = do (post MSGS.debugmsg) $ filter (neg null) L if null S; ! = post_msg1 S || do (post MSGS.debugmsg) $ filter (neg null) L otherwise; + //debugmsg S = printf "-> '%s'\n" S || S; + debugmsg S = S; + def BUF = ref ""; collect S where S = get BUF++S: |