summaryrefslogtreecommitdiff
path: root/lisp/comint.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-03-02 19:02:28 +0000
committerRichard M. Stallman <rms@gnu.org>1998-03-02 19:02:28 +0000
commitec5691271b1d5675b9782dcb1090721ce6c43383 (patch)
tree2e6194420f5c5746c6c823a34249ecb1cefaec90 /lisp/comint.el
parent21323706226d50cf5ce8aad5ae3d2bd952685f2a (diff)
downloademacs-ec5691271b1d5675b9782dcb1090721ce6c43383.tar.gz
(comint-arguments): Treat \" and such as part of one arg.
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el10
1 files changed, 9 insertions, 1 deletions
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)