From ec5691271b1d5675b9782dcb1090721ce6c43383 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 2 Mar 1998 19:02:28 +0000 Subject: [PATCH] (comint-arguments): Treat \" and such as part of one arg. --- lisp/comint.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/comint.el b/lisp/comint.el index 102cd1ec8c7..6c44a551123 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1126,7 +1126,15 @@ We assume whitespace separates arguments, except within quotes. Also, a run of one or more of a single character in `comint-delimiter-argument-list' is a separate argument. Argument 0 is the command name." - (let ((argpart "[^ \n\t\"'`]+\\|\\(\"[^\"]*\"\\|'[^']*'\\|`[^`]*`\\)") + ;; The first line handles ordinary characters and backslash-sequences. + ;; The second matches "-quoted strings. + ;; The third matches '-quoted strings. + ;; The fourth matches `-quoted strings. + ;; This seems to fit the syntax of BASH 2.0. + (let ((argpart "[^ \n\t\"'`\\]+\\|\\\\[\"'`\\]+\\|\ +\\(\"\\([^\"\\]\\|\\\\.\\)*\"\\|\ +'[^']*'\\|\ +`[^`]*`\\)") (args ()) (pos 0) (count 0) beg str value quotes)