emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ob-haxe c4d9e25: ob-haxe.el: Use shell-quote-argument i


From: Stefan Monnier
Subject: [elpa] externals/ob-haxe c4d9e25: ob-haxe.el: Use shell-quote-argument instead of regexp
Date: Sat, 30 Jan 2021 13:59:57 -0500 (EST)

branch: externals/ob-haxe
commit c4d9e256163191c29db4c6c19a4effc3f7e1237c
Author: Ian Martins <ianxm@jhu.edu>
Commit: Ian Martins <ianxm@jhu.edu>

    ob-haxe.el: Use shell-quote-argument instead of regexp
    
    * ob-haxe.el (org-babel-execute:haxe): Replace regexp with
    `shell-quote-argument' for escaping the neko or hashlink commands.
---
 ob-haxe.el | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/ob-haxe.el b/ob-haxe.el
index cf46ad5..6f5c529 100644
--- a/ob-haxe.el
+++ b/ob-haxe.el
@@ -43,16 +43,14 @@
 (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\".  This is
-run in a shell."
+path to the executable, like \"/usr/local/bin/neko\"."
   :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\".  This is run in a
-shell."
+to the executable, like \"/usr/local/bin/hl\"."
   :group 'org-babel
   :type 'string)
 
@@ -122,17 +120,14 @@ replaced in this string.")
 (defun org-babel-execute:haxe (body params)
   "Execute a haxe source block with BODY code and PARAMS params."
   (let* (;; allow header overrides
-         (org-babel-haxe-compiler
-          (or (cdr (assq :haxe params))
-              org-babel-haxe-compiler))
+         (org-babel-haxe-compiler (or (cdr (assq :haxe params))
+                                      org-babel-haxe-compiler))
          (org-babel-neko-command
-          (replace-regexp-in-string "\\([ \"]\\)" "\\\\\\1" ; escape double 
quotes or spaces
-                                    (or (cdr (assq :neko params))
-                                        org-babel-neko-command)))
+          (shell-quote-argument (or (cdr (assq :neko params))
+                                    org-babel-neko-command)))
          (org-babel-hashlink-command
-          (replace-regexp-in-string "\\([ \"]\\)" "\\\\\\1" ; escape double 
quotes or spaces
-                                    (or (cdr (assq :hashlink params))
-                                        org-babel-hashlink-command)))
+          (shell-quote-argument (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]