diff options
| author | Juanma Barranquero | 2003-06-12 22:20:49 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-06-12 22:20:49 +0000 |
| commit | 6ed020c8386a672048dda4ed80ee23c75cb20424 (patch) | |
| tree | cade116b8eb468efea485c4077db89677fc27b6f | |
| parent | b80263be1b94458dfbfdd2a23438a7888fcd4312 (diff) | |
| download | emacs-6ed020c8386a672048dda4ed80ee23c75cb20424.tar.gz emacs-6ed020c8386a672048dda4ed80ee23c75cb20424.zip | |
(shell-command-separator-regexp): New variable.
(shell-directory-tracker): Make regexp used for skipping to next command
correspond to one used for command itself.
| -rw-r--r-- | lisp/shell.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index 9905fde3712..fdf80cba220 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -202,6 +202,12 @@ This is used for directory tracking and does not do a perfect job." | |||
| 202 | :type 'regexp | 202 | :type 'regexp |
| 203 | :group 'shell) | 203 | :group 'shell) |
| 204 | 204 | ||
| 205 | (defcustom shell-command-separator-regexp "[;&|\n \t]*" | ||
| 206 | "*Regexp to match a single command within a pipeline. | ||
| 207 | This is used for directory tracking and does not do a perfect job." | ||
| 208 | :type 'regexp | ||
| 209 | :group 'shell) | ||
| 210 | |||
| 205 | (defcustom shell-completion-execonly t | 211 | (defcustom shell-completion-execonly t |
| 206 | "*If non-nil, use executable files only for completion candidates. | 212 | "*If non-nil, use executable files only for completion candidates. |
| 207 | This mirrors the optional behavior of tcsh. | 213 | This mirrors the optional behavior of tcsh. |
| @@ -608,7 +614,9 @@ Environment variables are expanded, see function `substitute-in-file-name'." | |||
| 608 | (if shell-dirtrackp | 614 | (if shell-dirtrackp |
| 609 | ;; We fail gracefully if we think the command will fail in the shell. | 615 | ;; We fail gracefully if we think the command will fail in the shell. |
| 610 | (condition-case chdir-failure | 616 | (condition-case chdir-failure |
| 611 | (let ((start (progn (string-match "^[; \t]*" str) ; skip whitespace | 617 | (let ((start (progn (string-match |
| 618 | (concat "^" shell-command-separator-regexp) | ||
| 619 | str) ; skip whitespace | ||
| 612 | (match-end 0))) | 620 | (match-end 0))) |
| 613 | end cmd arg1) | 621 | end cmd arg1) |
| 614 | (while (string-match shell-command-regexp str start) | 622 | (while (string-match shell-command-regexp str start) |
| @@ -634,7 +642,9 @@ Environment variables are expanded, see function `substitute-in-file-name'." | |||
| 634 | "\\)\\($\\|[ \t]\\)") | 642 | "\\)\\($\\|[ \t]\\)") |
| 635 | cmd)) | 643 | cmd)) |
| 636 | (shell-process-cd (comint-substitute-in-file-name cmd)))) | 644 | (shell-process-cd (comint-substitute-in-file-name cmd)))) |
| 637 | (setq start (progn (string-match "[; \t]*" str end) ; skip again | 645 | (setq start (progn (string-match shell-command-separator-regexp |
| 646 | str end) | ||
| 647 | ;; skip again | ||
| 638 | (match-end 0))))) | 648 | (match-end 0))))) |
| 639 | (error "Couldn't cd")))) | 649 | (error "Couldn't cd")))) |
| 640 | 650 | ||