Commit 356a3681 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/shell.el (shell-parse-pcomplete-arguments): Unquote args.

Fixes: debbugs:9160
parent dca4927e
2011-08-28 Stefan Monnier <monnier@iro.umontreal.ca>
* shell.el (shell-parse-pcomplete-arguments): Unquote args (bug#9160).
2011-08-27 Alan Mackenzie <acm@muc.de> 2011-08-27 Alan Mackenzie <acm@muc.de>
* progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Make it * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Make it
......
...@@ -393,10 +393,28 @@ to `dirtrack-mode'." ...@@ -393,10 +393,28 @@ to `dirtrack-mode'."
(while (< (point) end) (while (< (point) end)
(skip-chars-forward " \t\n") (skip-chars-forward " \t\n")
(push (point) begins) (push (point) begins)
(looking-at "\\(?:[^\s\t\n\\]\\|'[^']*'\\|\"\\(?:[^\"\\]\\|\\\\.\\)*\"\\|\\\\.\\)*\\(?:\\\\\\|'[^']*\\|\"\\(?:[^\"\\]\\|\\\\.\\)*\\)?") (let ((arg ()))
(goto-char (match-end 0)) (while (looking-at
(push (buffer-substring-no-properties (car begins) (point)) (eval-when-compile
args)) (concat
"\\(?:[^\s\t\n\\\"']+"
"\\|'\\([^']*\\)'?"
"\\|\"\\(\\(?:[^\"\\]\\|\\\\.\\)*\\)\"?"
"\\|\\\\\\(\\(?:.\\|\n\\)?\\)\\)")))
(goto-char (match-end 0))
(cond
((match-beginning 3) ;Backslash escape.
(push (if (= (match-beginning 3) (match-end 3))
"\\" (match-string 3))
arg))
((match-beginning 2) ;Double quote.
(push (replace-regexp-in-string
"\\\\\\(.\\)" "\\1" (match-string 2))
arg))
((match-beginning 1) ;Single quote.
(push (match-string 1) arg))
(t (push (match-string 0) arg))))
(push (mapconcat #'identity (nreverse arg) "") args)))
(cons (nreverse args) (nreverse begins))))) (cons (nreverse args) (nreverse begins)))))
(defun shell-completion-vars () (defun shell-completion-vars ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment