From: Mark Cox <markcox80@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Unwanted "(progn )" when Tangling Lisp Code
Date: Tue, 31 May 2011 11:39:38 +1000 [thread overview]
Message-ID: <BANLkTikGB2UGRD__jmgV9OqzuKQCOasKfA@mail.gmail.com> (raw)
Hi,
When tangling lisp source code blocks, the tangled code is wrapped in
a `(progn ,@body). For example,
the block
#+begin_src lisp :tangle example.lisp
(defun mischief ()
(/ 1 0))
#+end_src
produces
: (progn (defun mischief ()
: (/ 1 0))
: )
With the attached patch, the tangling process now produces
:
: (defun mischief ()
: (/ 1 0))
Thanks
Mark
Here is the patch.
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index a810d86..3382418 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -54,7 +54,7 @@
(format "(%S (quote %S))" (car var) (cdr var)))
vars "\n ")
")\n" body ")")
- (format "(progn %s)" body)))))
+ body))))
(if (or (member "code" result-params)
(member "pp" result-params))
(format "(pprint %s)" body)
@@ -65,7 +65,7 @@
(require 'slime)
(org-babel-reassemble-table
(with-temp-buffer
- (insert (org-babel-expand-body:lisp body params))
+ (insert (format "(progn\n %s)" (org-babel-expand-body:lisp body params)))
((lambda (result)
(if (member "output" (cdr (assoc :result-params params)))
(car result)
next reply other threads:[~2011-05-31 1:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 1:39 Mark Cox [this message]
2011-05-31 15:57 ` Unwanted "(progn )" when Tangling Lisp Code Eric Schulte
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=BANLkTikGB2UGRD__jmgV9OqzuKQCOasKfA@mail.gmail.com \
--to=markcox80@gmail.com \
--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).