From xemacs-m  Wed Sep 17 14:25:40 1997
Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id OAA14872
	for <xemacs-beta@xemacs.org>; Wed, 17 Sep 1997 14:25:39 -0500 (CDT)
Received: from Corp.Sun.COM ([129.145.35.78]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id MAA18652; Wed, 17 Sep 1997 12:25:08 -0700
Received: from legba.Corp.Sun.COM by Corp.Sun.COM (SMI-8.6/SMI-5.3)
	id MAA14170; Wed, 17 Sep 1997 12:25:05 -0700
Received: by legba.Corp.Sun.COM (SMI-8.6/SMI-SVR4)
	id MAA12261; Wed, 17 Sep 1997 12:25:07 -0700
To: karlheg@inetarena.com (Karl M. Hegbloom)
Cc: XEmacs BETA <xemacs-beta@xemacs.org>
Subject: Re: Karl's calc package
References: <bcivhzzztem.fsf@corp.Sun.COM> <87zppbdamo.fsf@bittersweet.inetarena.com>
X-Attribution: GDF
Mail-Copies-To: never
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: text/plain; charset=US-ASCII
From: Gary.Foster@Corp.Sun.COM (Gary D. Foster)
Date: 17 Sep 1997 12:25:07 -0700
In-Reply-To: karlheg@inetarena.com's message of "17 Sep 1997 12:05:19 -0700"
Message-ID: <bciraanu4j0.fsf@corp.Sun.COM>
Lines: 55
X-Mailer: Gnus v5.5/XEmacs 20.3(beta21) - "Bern"

>>>>> "Karl" == Karl M Hegbloom <karlheg@inetarena.com> writes:

>>>>> "GDF" == Gary D Foster <Gary.Foster@Corp.Sun.COM> writes:
    GDF> Is anyone else using Karl's calc package?  I got it working
    GDF> again under Bern, but the weird thing is that it doubles all
    GDF> my digit entries.

    Karl>  I have the same problem...  I don't *think* I caused it...
    Karl>  I haven't
    Karl> tried to figure out why it's doing that yet either.  My
    Karl> priority is *reading*; it _has_ to be, sorry.

Well, I fixed it here by changing the calc-enter function.

It used to look like this:

(defun calc-enter (n)
  (interactive "p")
  (calc-wrapper
   (cond ((< n 0)
          (calc-push-list (calc-top-list 1 (- n))))
         ((= n 0)
          (calc-push-list (calc-top-list (calc-stack-size))))
         (t
          (calc-push-list (calc-top-list n)))))
)

I removed the final (t ...) branch of the cond, and it started working 
correctly... I then tried recompiling calc.el to make it permanent,
and started getting _all sorts_ of weird errors, complaints about
general stuff, so I just tried re-defining the above in my init.el
file... which worked except that it hasn't a clue as to what
`calc-wrapper' is... so, in the fine tradition of slash-and-burn
debugging, I just whacked that out also.

So, by adding the following to my init.el, it started working:

# fix calc brain-damage by hacking it unmercifully

(require 'calc)

(defun calc-enter (n)
  (interactive "p")
  (cond ((< n 0)
         (calc-push-list (calc-top-list 1 (- n))))
        ((= n 0)
         (calc-push-list (calc-top-list (calc-stack-size)))))
)

I haven't delved deeply into what all the breakage is, since the
instant I recompile calc.el everything explodes in my face.  Did you,
perchance, use FSF emacs to compile calc.el, or do something else
differently or oddly?

-- Gary F.

