- Subject: calc.sl
- From: Günter Milde <g.milde@xxxxxx>
- Date: Mon, 17 Nov 2003 11:17:04 +0100
On Sat, Nov 15, 2003 at 08:54:11PM +0100, Marko Mahni? wrote:
> Hi!
> I have included your patch in version 1.3 of "calc".
> I have also added the revision history.
>
> Please, check it out.
Thanks for the new calc. It works nice here. (I did only a small test.)
I added contemporary doucmentation about adding a menu entry.
One more idea: with calc (instead of calc2) it would be nice to have it
printing all results , say as a tuple:
%-------------- :-) E5
1+4; 2+5;
%R: (5, 7)
%-------------- :-) E6
Then, *calcres* could be omitted (I do not
have to close two buffers when the calculation is ready.
Another idea:
How about using the sprint_variable function for
complex results (namely arrays)
It comes with my diagnose mode and does a (IMHO nice) rendering of complex
variables and their content. Try
http://jedmodes.sf.net/mode/diagnose/last/download
If you call it with something like
if(is_defined("sprint_variable"))
runhooks("sprint_variable", var);
else
insert(var);
no dependency is introduced but value added for people having
sprint_variable().
Günter
--
G.Milde at web.de
--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="calc.diff"
--- /home/milde/.jed/lib/calc-1.3.sl 2003-11-17 10:08:51.000000000 +0100
+++ /home/milde/.jed/lib/calc-1.3gm.sl 2003-11-17 10:19:35.000000000 +0100
@@ -1,7 +1,7 @@
%------------------calc.sl-------------------------------------
%% Simple SLang calculator
%% Version: 1.3
-%% Author: Marko Mahni? <marko.mahnic@xxxxxx>
+%% Author: Marko Mahnicz <marko.mahnic@xxxxxx>
%%
%%-------------------------------------------------------------
%% History:
@@ -28,16 +28,27 @@
%% M-x calc2
%% for two-window mode.
%%
-%% or in your .jedrc (this is for jed 99.13, see CHANGES.TXT to see
-%% how to do it in jed99.14)
+%% To get a Calc menu entry insert in your .jedrc:
+%%
+%% if you have jed 99.13:
%%
-%% static define load_popups_hook (menubar)
-%% {
-%% %
-%% menu_insert_item (3, "Global.S&ystem", "Ca&lculate", "calc");
-%% }
-%% variable Menu_Load_Popups_Hook = &load_popups_hook;
+%% static define load_popups_hook (menubar)
+%% {
+%% %
+%% menu_insert_item (3, "Global.S&ystem", "Ca&lculate", "calc");
+%% }
+%% variable Menu_Load_Popups_Hook = &load_popups_hook;
%%
+%% if you have a newer version than jed 99.13:
+%%
+%% define calc_load_popup_hook (menubar)
+%% {
+%% menu_insert_item (7, "Global.S&ystem", "&Calculate", "calc");
+%% }
+%% append_to_hook ("load_popup_hooks", &calc_load_popup_hook);
+%%
+%% or insert the menu_insert_item() function to an already defined
+%% *_load_popup_hook.
%%
%% A simple calculator that takes a SLang expression, evaluates
%% it and prints the result in the form of a comment after the
@@ -86,7 +97,7 @@
static variable format = "%.6f";
static variable exprid = 0;
static variable use_result_win = 0;
-static variable use_result_comment = 1; % 0 never, 1 not for arrays, 2 allways
+static variable use_result_comment = 1; % 0 never, 1 not for arrays, 2 always
static variable int_mode = 0; % 0 = dec, 1 = hex, 2 = oct, 3 = bin, 9 = all
static variable
--FL5UXtIhxfXey3p5--
--
G.Milde at web.de
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2003 date index]
[2003 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]