emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jan Malakhovski <oxij@oxij.org>
To: emacs-orgmode@gnu.org
Cc: Jan Malakhovski <oxij@oxij.org>
Subject: [PATCH 2/3] ob-calc: don't leave garbage on the stack
Date: Sun, 27 Dec 2015 14:47:55 +0000	[thread overview]
Message-ID: <1451227676-10899-3-git-send-email-oxij@oxij.org> (raw)
In-Reply-To: <1451227676-10899-1-git-send-email-oxij@oxij.org>

* 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 a8c50da..99d0a09 100644
--- a/lisp/ob-calc.el
+++ b/lisp/ob-calc.el
@@ -89,7 +89,9 @@
 	     (split-string (org-babel-expand-body:calc body params) "[\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-maybe-resolve-var (el)
   (if (consp el)
-- 
2.6.4

  parent reply	other threads:[~2015-12-27 14:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-27 14:47 [PATCH v3 part1 0/3] Fixes Jan Malakhovski
2015-12-27 14:47 ` [PATCH 1/3] org-clock: fix a typo Jan Malakhovski
2015-12-29 20:23   ` Nicolas Goaziou
2015-12-27 14:47 ` Jan Malakhovski [this message]
2015-12-29 20:23   ` [PATCH 2/3] ob-calc: don't leave garbage on the stack Nicolas Goaziou
2015-12-27 14:47 ` [PATCH 3/3] org-contacts: fix org-contacts-matcher for BIRTHDAYs Jan Malakhovski
2015-12-29 20:23   ` Nicolas Goaziou

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=1451227676-10899-3-git-send-email-oxij@oxij.org \
    --to=oxij@oxij.org \
    --cc=emacs-orgmode@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).