1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-26 10:49:33 +00:00

(comint-arguments): Treat \" and such as part of one arg.

This commit is contained in:
Richard M. Stallman 1998-03-02 19:02:28 +00:00
parent 2132370622
commit ec5691271b

View File

@ -1126,7 +1126,15 @@ We assume whitespace separates arguments, except within quotes.
Also, a run of one or more of a single character Also, a run of one or more of a single character
in `comint-delimiter-argument-list' is a separate argument. in `comint-delimiter-argument-list' is a separate argument.
Argument 0 is the command name." 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) (args ()) (pos 0)
(count 0) (count 0)
beg str value quotes) beg str value quotes)