all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris Zheng <chriszheng99@gmail.com>
To: 20764@debbugs.gnu.org
Subject: bug#20764: 25.0.50; Minor improvements for calculator.el
Date: Mon, 08 Jun 2015 02:39:51 +0800	[thread overview]
Message-ID: <20150608.023951.324799427836228432.chriszheng99@gmail.com> (raw)


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






             reply	other threads:[~2015-06-07 18:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-07 18:39 Chris Zheng [this message]
2015-06-17 13:43 ` bug#20764: 25.0.50; Minor improvements for calculator.el 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150608.023951.324799427836228432.chriszheng99@gmail.com \
    --to=chriszheng99@gmail.com \
    --cc=20764@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.