]> code.delx.au - gnu-emacs-elpa/commitdiff
Use shell-quote-argument in shell-quasiquote.el
authorEli Zaretskii <eliz@gnu.org>
Sun, 25 Oct 2015 21:06:45 +0000 (23:06 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 25 Oct 2015 21:06:45 +0000 (23:06 +0200)
* packages/shell-quasiquote/shell-quasiquote.el (shqq--quote-atom):
Use shell-quote-argument.
(shqq--quote-string): Function deleted.

packages/shell-quasiquote/shell-quasiquote.el

index 1d08defba6ad9b8b6525194ebc69675f7066ba37..bdea46abfdbf1f951aaca486e5c6046da7bb286f 100644 (file)
 \f
 ;;; 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.