branch: master
commit d455ee3ed9e12573a297d1c828b5a09500d90e2e
Author: Eli Zaretskii <[email protected]>
Commit: Eli Zaretskii <[email protected]>
Use shell-quote-argument in shell-quasiquote.el
* packages/shell-quasiquote/shell-quasiquote.el (shqq--quote-atom):
Use shell-quote-argument.
(shqq--quote-string): Function deleted.
---
packages/shell-quasiquote/shell-quasiquote.el | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/packages/shell-quasiquote/shell-quasiquote.el
b/packages/shell-quasiquote/shell-quasiquote.el
index 1d08def..bdea46a 100644
--- a/packages/shell-quasiquote/shell-quasiquote.el
+++ b/packages/shell-quasiquote/shell-quasiquote.el
@@ -58,11 +58,6 @@
;;; Code:
-;;; We don't use `shell-quote-argument' because it doesn't provide any safety
-;;; guarantees, and this quotes shell keywords as well.
-(defun shqq--quote-string (string)
- (concat "'" (replace-regexp-in-string "'" "'\\\\''" string) "'"))
-
(defun shqq--atom-to-string (atom)
(cond
((symbolp atom) (symbol-name atom))
@@ -71,7 +66,7 @@
(t (error "Bad shqq atom: %S" atom))))
(defun shqq--quote-atom (atom)
- (shqq--quote-string (shqq--atom-to-string atom)))
+ (shell-quote-argument (shqq--atom-to-string atom)))
(defun shqq--match-comma (form)
"Matches FORM against ,foo i.e. (\, foo) and returns foo.