]> git.eshelyaron.com Git - emacs.git/commitdiff
doc/misc/calc.texi (Quick Calculator): Mention prefix argument of
authorChristopher Schmidt <ch@ristopher.com>
Wed, 29 Oct 2014 00:37:37 +0000 (19:37 -0500)
committerJay Belanger <jay.p.belanger@gmail.com>
Wed, 29 Oct 2014 00:37:37 +0000 (19:37 -0500)
`quick-calc'.

etc/NEWS: Mention prefix argument of `quick-calc'.

lisp/calc/calc.el (quick-calc):
lisp/calc/calc-aent.el (calc-do-quick-calc): New argument INSERT.

doc/misc/ChangeLog
doc/misc/calc.texi
etc/ChangeLog
etc/NEWS
lisp/ChangeLog
lisp/calc/calc-aent.el
lisp/calc/calc.el

index 462e7b6bbd3f8d85457531013c7cc4108d9bc0b7..c5daf44af911b898212779d619e36420fa393de0 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-28  Christopher Schmidt  <ch@ristopher.com>
+
+       * calc.texi (Quick Calculator): Mention prefix argument of
+       `quick-calc'.
+
 2014-10-26  Eric S. Raymond  <esr@thyrsus.com>
 
        * efaq-w32.texi: Neutralized language specific to a repository type.
index 2e9d71acd4f522cfdbdeffe3712d12c7a2b1bb23..ede9598c281bdebd3a346993a235af49a9a96208 100644 (file)
@@ -10168,9 +10168,10 @@ to yank the result into the next @kbd{C-x * q} input line as a more
 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).
index 1a33d958b50a6288261c7cd63a3157cb83412d8c..4717d3011f59cae09d6df20242c039f622ab6489 100644 (file)
@@ -1,3 +1,7 @@
+2014-09-13  Christopher Schmidt  <ch@ristopher.com>
+
+       * NEWS: Mention prefix argument of `quick-calc'.
+
 2014-10-20  Glenn Morris  <rgm@gnu.org>
 
        * Merge in all changes up to 24.4 release.
index 42608f1d5a3793de076932587fb87cbd31f5964d..27b58fefbebfa39db9841e6bd8d8f194c00976d7 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -127,6 +127,11 @@ Unicode standards.
 \f
 * Changes in Specialized Modes and Packages in Emacs 25.1
 
+** Calc
++++
+*** If `quick-calc' is called with a prefix argument, insert the
+result of the calculation into the current buffer.
+
 ** ElDoc
 *** New minor mode global-eldoc-mode
 *** eldoc-documentation-function now defaults to nil
index 1c166b164ee4b7fc053ae1ba33cc73fbf9968e4f..967e4a74c14a112636d5f48e84d79df6029363e5 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-28  Christopher Schmidt  <ch@ristopher.com>
+
+       * calc/calc.el (quick-calc):
+       * calc/calc-aent.el (calc-do-quick-calc): New argument INSERT.
+
 2014-10-28  Sam Steingold  <sds@gnu.org>
 
        * net/rcirc.el (rcirc-fill-column): Allow any symbolic value for
index 107c0ae4ce450cfdfcf2d547c10fd588175210f1..968d30ee60a915ffba2e2f315a6a9a28d94259ab 100644 (file)
@@ -52,7 +52,7 @@
   "The history list for quick-calc.")
 
 ;;;###autoload
-(defun calc-do-quick-calc ()
+(defun calc-do-quick-calc (&optional insert)
   (require 'calc-ext)
   (calc-check-defines)
   (if (eq major-mode 'calc-mode)
                    (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)))))
 
index 04d852e5cb3c5128d9a760d06742b9e902dfbf0f..85266fbac32612725675e1942377478c3b310c00 100644 (file)
 (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 @@ commands given here will actually operate on the *Calculator* stack."
         (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)