diff options
| -rw-r--r-- | lisp/shell.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index 2110dea3582..7550d7f4a67 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -589,7 +589,7 @@ See `shell-command-regexp'." | |||
| 589 | (let ((limit (save-excursion (end-of-line nil) (point)))) | 589 | (let ((limit (save-excursion (end-of-line nil) (point)))) |
| 590 | (if (re-search-forward (concat shell-command-regexp "\\([;&|][\\s ]*\\)+") | 590 | (if (re-search-forward (concat shell-command-regexp "\\([;&|][\\s ]*\\)+") |
| 591 | limit 'move arg) | 591 | limit 'move arg) |
| 592 | (skip-syntax-backward "^\\s ")))) | 592 | (skip-syntax-backward " ")))) |
| 593 | 593 | ||
| 594 | 594 | ||
| 595 | (defun shell-backward-command (&optional arg) | 595 | (defun shell-backward-command (&optional arg) |
| @@ -597,11 +597,13 @@ See `shell-command-regexp'." | |||
| 597 | See `shell-command-regexp'." | 597 | See `shell-command-regexp'." |
| 598 | (interactive "p") | 598 | (interactive "p") |
| 599 | (let ((limit (save-excursion (comint-bol nil) (point)))) | 599 | (let ((limit (save-excursion (comint-bol nil) (point)))) |
| 600 | (skip-syntax-backward "\\s " limit) | 600 | (if (> limit (point)) |
| 601 | (save-excursion (beginning-of-line) (setq limit (point)))) | ||
| 602 | (skip-syntax-backward " " limit) | ||
| 601 | (if (re-search-backward | 603 | (if (re-search-backward |
| 602 | (format "[;&|]+[\\s ]*\\(%s\\)" shell-command-regexp) limit 'move arg) | 604 | (format "[;&|]+[\\s ]*\\(%s\\)" shell-command-regexp) limit 'move arg) |
| 603 | (progn (goto-char (match-beginning 1)) | 605 | (progn (goto-char (match-beginning 1)) |
| 604 | (skip-syntax-backward "^\\s "))))) | 606 | (skip-chars-forward ";&|"))))) |
| 605 | 607 | ||
| 606 | 608 | ||
| 607 | (defun shell-get-current-command () | 609 | (defun shell-get-current-command () |