summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJordan Brown <mrhmouse@gmail.com>2016-09-21 10:07:21 -0400
committerJose Antonio Ortega Ruiz <jao@gnu.org>2016-09-30 06:06:25 +0200
commitcec661b7d0e6d0eda31a97b5621d361ae5c71de3 (patch)
tree7554f931913461b24c41abc969d4b391f8e31a31 /elisp
parentf8ddc4e540ec9c193efde588e6bb8cb887212820 (diff)
downloadgeiser-guile-cec661b7d0e6d0eda31a97b5621d361ae5c71de3.tar.gz
geiser-guile-cec661b7d0e6d0eda31a97b5621d361ae5c71de3.tar.bz2
Use (car (process-lines ...)) instead of (shell-command ...)
`shell-command` assumes Bourne-shell-compatible quoting, which doesn't work when the user isn't using a Bourne-compatible shell. Instead of futzing about with quoting, we can just use `process-lines` to execute a process and pass it arguments directly.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-chez.el4
-rw-r--r--elisp/geiser-chibi.el7
-rw-r--r--elisp/geiser-chicken.el5
-rw-r--r--elisp/geiser-guile.el5
-rw-r--r--elisp/geiser-mit.el10
-rw-r--r--elisp/geiser-racket.el5
6 files changed, 13 insertions, 23 deletions
diff --git a/elisp/geiser-chez.el b/elisp/geiser-chez.el
index 1793cfd..17b6c8d 100644
--- a/elisp/geiser-chez.el
+++ b/elisp/geiser-chez.el
@@ -96,9 +96,7 @@ This function uses `geiser-chez-init-file' if it exists."
(defconst geiser-chez-minimum-version "9.4")
(defun geiser-chez--version (binary)
- (shell-command-to-string
- (format "%s --version"
- (shell-quote-argument binary))))
+ (car (process-lines binary "--version")))
(defun geiser-chez--startup (remote)
(let ((geiser-log-verbose-p t))
diff --git a/elisp/geiser-chibi.el b/elisp/geiser-chibi.el
index cb2577e..acb8b61 100644
--- a/elisp/geiser-chibi.el
+++ b/elisp/geiser-chibi.el
@@ -97,10 +97,9 @@ This function uses `geiser-chibi-init-file' if it exists."
(defconst geiser-chibi-minimum-version "0.7.3")
(defun geiser-chibi--version (binary)
- (second (split-string (shell-command-to-string
- (format "%s -V"
- (shell-quote-argument binary)))
- " ")))
+ (second (split-string
+ (car (process-lines binary "-V"))
+ " ")))
(defun geiser-chibi--startup (remote)
(let ((geiser-log-verbose-p t))
diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el
index 8c10908..60567b7 100644
--- a/elisp/geiser-chicken.el
+++ b/elisp/geiser-chicken.el
@@ -263,10 +263,7 @@ This function uses `geiser-chicken-init-file' if it exists."
(defconst geiser-chicken-minimum-version "4.8.0.0")
(defun geiser-chicken--version (binary)
- (shell-command-to-string
- (format "%s -e %s"
- (shell-quote-argument binary)
- (shell-quote-argument "(display (chicken-version))"))))
+ (car (process-lines binary "-e" "(display (chicken-version))")))
(defun connect-to-chicken ()
"Start a Chicken REPL connected to a remote process."
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index de2e23f..dacca55 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -334,10 +334,7 @@ This function uses `geiser-guile-init-file' if it exists."
(defconst geiser-guile-minimum-version "2.0")
(defun geiser-guile--version (binary)
- (shell-command-to-string
- (format "%s -c %s"
- (shell-quote-argument binary)
- (shell-quote-argument "(display (version))"))))
+ (car (process-lines binary "-c" "(display (version))")))
(defun geiser-guile-update-warning-level ()
"Update the warning level used by the REPL.
diff --git a/elisp/geiser-mit.el b/elisp/geiser-mit.el
index 5e61cf1..fffcfb6 100644
--- a/elisp/geiser-mit.el
+++ b/elisp/geiser-mit.el
@@ -120,10 +120,12 @@ This function uses `geiser-mit-init-file' if it exists."
(defconst geiser-mit-minimum-version "9.1.1")
(defun geiser-mit--version (binary)
- (shell-command-to-string
- (format "%s --quiet --no-init-file --eval %s"
- (shell-quote-argument binary)
- "'(begin (display (get-subsystem-version-string \"Release\")) (%exit 0))'")))
+ (car (process-lines binary
+ "--quiet"
+ "--no-init-file"
+ "--eval"
+ "(begin (display (get-subsystem-version-string \"Release\"))
+ (%exit 0))")))
(defconst geiser-mit--path-rx "^In \\([^:\n ]+\\):\n")
(defun geiser-mit--startup (remote)
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el
index ac7626a..c51b08c 100644
--- a/elisp/geiser-racket.el
+++ b/elisp/geiser-racket.el
@@ -363,10 +363,7 @@ using start-geiser, a procedure in the geiser/server module."
(defvar geiser-racket-minimum-version "5.3")
(defun geiser-racket--version (binary)
- (shell-command-to-string
- (format "%s -e %s"
- (shell-quote-argument binary)
- (shell-quote-argument "(display (version))"))))
+ (car (process-lines binary "-e" "(display (version))")))
(defvar geiser-racket--image-cache-dir nil)