From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Malakhovski Subject: [PATCH 9/9] ob-calc: don't leave garbage on the stack Date: Tue, 3 Nov 2015 20:15:47 +0000 Message-ID: <1446581747-1960-10-git-send-email-oxij@oxij.org> References: <1446581747-1960-1-git-send-email-oxij@oxij.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zti0J-0002dc-QQ for emacs-orgmode@gnu.org; Tue, 03 Nov 2015 15:16:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zti0J-0004Uw-16 for emacs-orgmode@gnu.org; Tue, 03 Nov 2015 15:16:27 -0500 Received: from fujibayashi-1-pt.tunnel.tserv10.par1.ipv6.he.net ([2001:470:1f12:446::2]:29112 helo=tricoro.koumakan.jp) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zti0I-0004Ug-Sh for emacs-orgmode@gnu.org; Tue, 03 Nov 2015 15:16:26 -0500 In-Reply-To: <1446581747-1960-1-git-send-email-oxij@oxij.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Jan Malakhovski * lisp/ob-calc.el (org-babel-calc-eval-string): Clean up the stack after expression evaluation. --- lisp/ob-calc.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ob-calc.el b/lisp/ob-calc.el index e8b43e7..2656f27 100644 --- a/lisp/ob-calc.el +++ b/lisp/ob-calc.el @@ -196,7 +196,9 @@ See `org-babel-calc-eval' for more info." (mapc #'org-babel-calc-eval-line (split-string text "[\n\r]")) (save-excursion (with-current-buffer (get-buffer "*Calculator*") - (calc-eval (calc-top 1))))) + (prog1 + (calc-eval (calc-top 1) + (calc-pop 1)))))) (defun org-babel-calc-eval-line (line) (let ((line (org-babel-trim line))) -- 2.6.2