From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christopher Schmidt Newsgroups: gmane.emacs.bugs Subject: bug#18469: 24.4.50; quick-calc: Insert result into the current buffer Date: Sat, 13 Sep 2014 14:40:54 -0400 (EDT) Message-ID: <87r3zfpdn1@ristopher.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1410633744 13357 80.91.229.3 (13 Sep 2014 18:42:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Sep 2014 18:42:24 +0000 (UTC) To: 18469@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 13 20:42:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XSsH2-0005Um-AH for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Sep 2014 20:42:16 +0200 Original-Received: from localhost ([::1]:51426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSsH1-0005Ax-MR for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Sep 2014 14:42:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSsGt-0005AT-OT for bug-gnu-emacs@gnu.org; Sat, 13 Sep 2014 14:42:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSsGp-0002j6-0h for bug-gnu-emacs@gnu.org; Sat, 13 Sep 2014 14:42:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSsGo-0002j2-Tx for bug-gnu-emacs@gnu.org; Sat, 13 Sep 2014 14:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XSsGo-0003K7-8w for bug-gnu-emacs@gnu.org; Sat, 13 Sep 2014 14:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christopher Schmidt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Sep 2014 18:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18469 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141063367812715 (code B ref -1); Sat, 13 Sep 2014 18:42:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Sep 2014 18:41:18 +0000 Original-Received: from localhost ([127.0.0.1]:40412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XSsG5-0003Iz-0w for submit@debbugs.gnu.org; Sat, 13 Sep 2014 14:41:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33129) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XSsG1-0003Ir-Vm for submit@debbugs.gnu.org; Sat, 13 Sep 2014 14:41:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSsFv-0002bH-2u for submit@debbugs.gnu.org; Sat, 13 Sep 2014 14:41:11 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSsFu-0002bD-Vs for submit@debbugs.gnu.org; Sat, 13 Sep 2014 14:41:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSsFq-000540-FX for bug-gnu-emacs@gnu.org; Sat, 13 Sep 2014 14:41:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSsFk-0002ad-Rh for bug-gnu-emacs@gnu.org; Sat, 13 Sep 2014 14:41:02 -0400 Original-Received: from ristopher.com ([81.4.108.209]:54160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSsFk-0002aY-HX for bug-gnu-emacs@gnu.org; Sat, 13 Sep 2014 14:40:56 -0400 Original-Received: by ristopher.com (Postfix, from userid 0) id B355020650; Sat, 13 Sep 2014 14:40:54 -0400 (EDT) Mail-Followup-To: bug-gnu-emacs@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93347 Archived-At: --=-=-= Content-Type: text/plain severity: wishlist There is this nifty feature of quick-calc (C-x * q): (info "(calc)Quick Calculator") If you finish your formula by typing (or `C-j') instead of , 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline --- doc/misc/ChangeLog +++ doc/misc/ChangeLog @@ -1,3 +1,8 @@ +2014-09-13 Christopher Schmidt + + * calc.texi (Quick Calculator): + Mention prefix argument of `quick-calc'. (Bug#) + 2014-09-04 Paul Eggert 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 + * 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 + * 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) --=-=-=--