[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ob-haxe d10f2b1: ob-haxe.el: Escape special characters
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ob-haxe d10f2b1: ob-haxe.el: Escape special characters in shell commands |
Date: |
Fri, 29 Jan 2021 09:20:01 -0500 (EST) |
branch: externals/ob-haxe
commit d10f2b116c84cd896cfd2e3c12c3ce8efb9caeae
Author: Ian Martins <ianxm@jhu.edu>
Commit: Ian Martins <ianxm@jhu.edu>
ob-haxe.el: Escape special characters in shell commands
* ob-haxe.el (org-babel-execute:haxe): Escape quotes or spaces in the
neko or hashlink commands since they're inserted into a shell command
inside of double quotes.
---
ob-haxe.el | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/ob-haxe.el b/ob-haxe.el
index 16686ca..cf46ad5 100644
--- a/ob-haxe.el
+++ b/ob-haxe.el
@@ -43,16 +43,16 @@
(defcustom org-babel-neko-command "neko"
"Name of the neko command.
May be either a command in the path, like \"neko\" or the full
-path to the executable, like \"/usr/local/bin/neko\". Double
-quotes must be escaped. This is run in a shell."
+path to the executable, like \"/usr/local/bin/neko\". This is
+run in a shell."
:group 'org-babel
:type 'string)
(defcustom org-babel-hashlink-command "hl"
"Name of the hashlink command.
May be either a command in the path, like \"hl\" or the full path
-to the executable, like \"/usr/local/bin/hl\". Double quotes
-must be escaped. This is run in a shell."
+to the executable, like \"/usr/local/bin/hl\". This is run in a
+shell."
:group 'org-babel
:type 'string)
@@ -126,11 +126,13 @@ replaced in this string.")
(or (cdr (assq :haxe params))
org-babel-haxe-compiler))
(org-babel-neko-command
- (or (cdr (assq :neko params))
- org-babel-neko-command))
+ (replace-regexp-in-string "\\([ \"]\\)" "\\\\\\1" ; escape double
quotes or spaces
+ (or (cdr (assq :neko params))
+ org-babel-neko-command)))
(org-babel-hashlink-command
- (or (cdr (assq :hashlink params))
- org-babel-hashlink-command))
+ (replace-regexp-in-string "\\([ \"]\\)" "\\\\\\1" ; escape double
quotes or spaces
+ (or (cdr (assq :hashlink params))
+ org-babel-hashlink-command)))
;; if true, run from babel temp directory
(run-from-temp (not (alist-get :dir params)))
;; class and package
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/ob-haxe d10f2b1: ob-haxe.el: Escape special characters in shell commands,
Stefan Monnier <=