unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20764: 25.0.50; Minor improvements for calculator.el
@ 2015-06-07 18:39 Chris Zheng
  2015-06-17 13:43 ` N. Jackson
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Zheng @ 2015-06-07 18:39 UTC (permalink / raw)
  To: 20764


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 <chriszheng99@gmail.com>
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






^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-02-24 20:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-07 18:39 bug#20764: 25.0.50; Minor improvements for calculator.el Chris Zheng
2015-06-17 13:43 ` N. Jackson
2015-06-17 14:47   ` Jay Belanger
2015-06-17 16:12     ` N. Jackson
2016-02-23 10:31     ` Lars Ingebrigtsen
2016-02-23 16:40       ` Chris Zheng
2016-02-23 17:50         ` Eli Zaretskii
2016-02-24  1:23           ` Lars Ingebrigtsen
2016-02-24  3:47             ` Eli Zaretskii
2016-02-24  3:54               ` Lars Ingebrigtsen
2016-02-24 20:36                 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).