emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#18469: closed (24.4.50; quick-calc: Insert result


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#18469: closed (24.4.50; quick-calc: Insert result into the current buffer)
Date: Wed, 29 Oct 2014 00:43:02 +0000

Your message dated Tue, 28 Oct 2014 19:42:52 -0500
with message-id <address@hidden>
and subject line Re: bug#18469: 24.4.50; quick-calc: Insert result into the 
current buffer
has caused the debbugs.gnu.org bug report #18469,
regarding 24.4.50; quick-calc: Insert result into the current buffer
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
18469: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18469
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.4.50; quick-calc: Insert result into the current buffer Date: Sat, 13 Sep 2014 14:40:54 -0400 (EDT)
severity: wishlist

There is this nifty feature of quick-calc (C-x * q):

    (info "(calc)Quick Calculator")

    If you finish your formula by typing <LFD> (or `C-j') instead of
    <RET>, the result is inserted immediately into the current buffer
    rather than going into the kill ring.

This should be mentioned in the doc string.

In fact, considering that inserting the result of a quick calculation
into the current is an elementary use case, quick-calc's prefix arg
should be dedicated to enabling this feature.

--- doc/misc/ChangeLog
+++ doc/misc/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-13  Christopher Schmidt  <address@hidden>
+
+       * calc.texi (Quick Calculator):
+       Mention prefix argument of `quick-calc'.  (Bug#)
+
 2014-09-04  Paul Eggert  <address@hidden>
 
        Less chatter in 'make' output.
--- doc/misc/calc.texi
+++ doc/misc/calc.texi
@@ -10168,9 +10168,10 @@
 explicit alternative to @kbd{$} notation, or to yank the result
 into the Calculator stack after typing @kbd{C-x * c}.
 
-If you finish your formula by typing @key{LFD} (or @kbd{C-j}) instead
-of @key{RET}, the result is inserted immediately into the current
-buffer rather than going into the kill ring.
+If you give a prefix argument to @kbd{C-x * q} or finish your formula
+by typing @key{LFD} (or @kbd{C-j}) instead of @key{RET}, the result is
+inserted immediately into the current buffer rather than going into
+the kill ring.
 
 Quick Calculator results are actually evaluated as if by the @kbd{=}
 key (which replaces variable names by their stored values, if any).
--- etc/ChangeLog
+++ etc/ChangeLog
@@ -1,5 +1,7 @@
 2014-09-13  Christopher Schmidt  <address@hidden>
 
+       * NEWS: Mention prefix argument of `quick-calc'.  (Bug#)
+
        * NEWS: Mention nil `calendar-mode-line-format' will not modify
        the mode line of the calendar buffer.  (Bug#18467)
 
--- etc/NEWS
+++ etc/NEWS
@@ -116,6 +116,11 @@
 ** Macro `minibuffer-with-setup-hook' takes (:append FUN) to mean
 appending FUN to `minibuffer-setup-hook'.
 
+** Calc
+
+*** If `quick-calc' is called with a prefix argument, insert the
+result of the calculation into the current buffer.
+
 ** Calendar and diary
 
 +++
--- lisp/ChangeLog
+++ lisp/ChangeLog
@@ -1,5 +1,9 @@
 2014-09-13  Christopher Schmidt  <address@hidden>
 
+       * calc/calc.el (quick-calc):
+       * calc/calc-aent.el (calc-do-quick-calc):
+       New argument INSERT.  (Bug#)
+
        * calendar/calendar.el (calendar-update-mode-line):
        Do not overwrite mode-line-format if calendar-mode-line-format is
        nil.  (Bug#18467)
--- lisp/calc/calc-aent.el
+++ lisp/calc/calc-aent.el
@@ -52,7 +52,8 @@
   "The history list for quick-calc.")
 
 ;;;###autoload
-(defun calc-do-quick-calc ()
+(defun calc-do-quick-calc (&optional insert)
+  (interactive "P")
   (require 'calc-ext)
   (calc-check-defines)
   (if (eq major-mode 'calc-mode)
@@ -108,7 +109,8 @@
                    (setq buf long))))
          (calc-handle-whys)
          (message "Result: %s" buf)))
-      (if (eq last-command-event 10)
+      (if (or insert
+             (eq last-command-event 10))
          (insert shortbuf)
         (kill-new shortbuf)))))
 
--- lisp/calc/calc.el
+++ lisp/calc/calc.el
@@ -147,7 +147,7 @@
 (declare-function calc-edit-finish "calc-yank" (&optional keep))
 (declare-function calc-edit-cancel "calc-yank" ())
 (declare-function calc-locate-cursor-element "calc-yank" (pt))
-(declare-function calc-do-quick-calc "calc-aent" ())
+(declare-function calc-do-quick-calc "calc-aent" (&optional insert))
 (declare-function calc-do-calc-eval "calc-aent" (str separator args))
 (declare-function calc-do-keypad "calc-keypd" (&optional full-display 
interactive))
 (declare-function calcFunc-unixtime "calc-forms" (date &optional zone))
@@ -1549,10 +1549,12 @@
         (and kbuf (bury-buffer kbuf))))))
 
 ;;;###autoload
-(defun quick-calc ()
-  "Do a quick calculation in the minibuffer without invoking full Calculator."
-  (interactive)
-  (calc-do-quick-calc))
+(defun quick-calc (&optional insert)
+  "Do a quick calculation in the minibuffer without invoking full Calculator.
+With prefix argument INSERT, insert the result in the current
+buffer.  Otherwise, the result is copied into the kill ring."
+  (interactive "P")
+  (calc-do-quick-calc insert))
 
 ;;;###autoload
 (defun calc-eval (str &optional separator &rest args)

--- End Message ---
--- Begin Message --- Subject: Re: bug#18469: 24.4.50; quick-calc: Insert result into the current buffer Date: Tue, 28 Oct 2014 19:42:52 -0500 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
The patch has been committed.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]