Subject: 25.0.50; Minor improvements for calculator.el

From: Chris Zheng <[email-masked]>
Date: Mon, 08 Jun 2015 02:39:51 +0800

Hello, Emacs.

I find the calculator.el in Emacs is handy.  However, there are two
things I'd like to see changed.

1. Press F1 results in `??bad key?? (f1)'.
2. Can't enter exponent by `E'.

Both of them can be reproduced by: (1) emacs -Q; (2) M-x calculator; (3)
Press `F1' or `E'.  I have the following patch trying to fix the above
two things.  Please let me know if I'm doing things wrong.

Best Regards,
Chris

>From 12e6d1e28060ba1ef2218a1ad37e26e02c4a1cb0 Mon Sep 17 00:00:00 2001
From: Chris Zheng <[email-masked]>
Date: Sat, 6 Jun 2015 08:48:25 +0200
Subject: [PATCH] Minor improvements for lisp/calculator.el.

* calculator.el (calculator-mode-map): Bind `E' for `calculator-exp'.
(calculator-last-input): Fix a bug that press F1 results in
`??bad key?? (f1)'.
---
 lisp/calculator.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/calculator.el b/lisp/calculator.el
index 4027887..d20faa3 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -394,7 +394,7 @@ Used for repeating operations in calculator-repR/L.")
                                      [kp-5] [kp-6] [kp-7] [kp-8] [kp-9])
              (calculator-op          [kp-divide] [kp-multiply])
              (calculator-decimal     "." [kp-decimal])
-             (calculator-exp         "e")
+             (calculator-exp         "e" "E")
              (calculator-dec/deg-mode "D")
              (calculator-set-register "s")
              (calculator-get-register "g")
@@ -1219,7 +1219,7 @@ arguments."
   "Last char (or event or event sequence) that was read.
 Use KEYS if given, otherwise use `this-command-keys'."
   (let ((inp (or keys (this-command-keys))))
-    (if (or (stringp inp) (not (arrayp inp)))
+    (if (or (stringp inp) (not (arrayp inp)) (member inp '([f1] [help])))
       inp
       ;; Translates kp-x to x and [tries to] create a string to lookup
       ;; operators; assume all symbols are translatable via
-- 
2.4.2

In GNU Emacs 25.0.50.2 (x86_64-w64-mingw32)
 of 2015-06-05 on KAEL
Windowing system distributor `Microsoft Corp.', version 6.3.9600
Configured using:
 `configure --prefix=/z/emacs --host=x86_64-w64-mingw32
 --target=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --with-wide-int
 --with-jpeg --with-xpm --with-png --with-tiff --with-rsvg --with-xml2
 --with-gnutls --with-sound=yes --with-file-notification=yes
 --without-dbus --without-imagemagick 'CFLAGS=-O3 -fomit-frame-pointer
 -g0 -pipe' 'LDFLAGS=-static-libgcc -static-libstdc++ -static -s
 -Wl,-s''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS