From: Mike Ivanov <mike@daatsys.com>
To: emacs-orgmode@gnu.org
Subject: Patch: strip (unneeded) quotes from singular value results
Date: Sat, 07 Sep 2019 11:26:55 -0700 [thread overview]
Message-ID: <989101179298a3d30db88714bb09367edce54772.camel@daatsys.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 285 bytes --]
Hi there,
Here's a TINYCHANGE patch that fixes an issue in ob-lisp.el.
Before:
#+BEGIN_SRC lisp :results file
"plot.png"
#+END_SRC
#+RESULTS:
[[file:"plot.png"]] <-- which is wrong
After:
#+BEGIN_SRC lisp :results file
"plot.png"
#+END_SRC
#+RESULTS:
[[file:plot.png]]
Mike
[-- Attachment #2: 0001-ob-lisp.el-Strip-quotes-from-result-value.patch --]
[-- Type: text/x-patch, Size: 1292 bytes --]
From 414af442fed1ef1b94613638330071cef4250645 Mon Sep 17 00:00:00 2001
From: Mike Ivanov <mike@daatsys.com>
Date: Sat, 7 Sep 2019 11:03:46 -0700
Subject: [PATCH] ob-lisp.el: Strip quotes from result value
* lisp/ob-lisp.el (org-babel-execute:lisp): Make sure that when a
singular string value is returned, it has no quotation marks around
it.
Before this change, the code below would produce an incorrect result:
#+BEGIN_SRC lisp :results file
"plot.png"
#+END_SRC
#+RESULTS:
[[file:"plot.png"]]
After the change:
#+BEGIN_SRC lisp :results file
"plot.png"
#+END_SRC
#+RESULTS:
[[file:plot.png]]
TINYCHANGE
---
lisp/ob-lisp.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index e717fc34e..0afb8c053 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -107,7 +107,7 @@ a property list containing the parameters of the block."
(point-min) (point-max)))))
(cdr (assq :package params)))))))
(org-babel-result-cond (cdr (assq :result-params params))
- result
+ (org-babel-strip-quotes result)
(condition-case nil
(read (org-babel-lisp-vector-to-list result))
(error result))))
--
2.20.1
next reply other threads:[~2019-09-07 18:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-07 18:26 Mike Ivanov [this message]
2019-09-16 16:39 ` Patch: strip (unneeded) quotes from singular value results 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=989101179298a3d30db88714bb09367edce54772.camel@daatsys.com \
--to=mike@daatsys.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).