diff options
author | Richard M. Stallman <rms@gnu.org> | 1993-12-24 05:42:58 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1993-12-24 05:42:58 +0000 |
commit | 6e65271c18730bc4165d00abb2981631376e79d3 (patch) | |
tree | 7cb182b252d3fc8b01c94f81da89bc4c3a2b2dce /lisp/shell.el | |
parent | ec73d6e2d737a7df48b8db5f89457de6310839df (diff) | |
download | emacs-6e65271c18730bc4165d00abb2981631376e79d3.tar.gz |
(shell-backward-command): If comint-bol moves forward,
use real beginning of line instead.
Use skip-syntax-backward properly.
If backward search finds a separator, move forward over it.
(shell-forward-command): Call skip-syntax-backward properly.
Diffstat (limited to 'lisp/shell.el')
-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'." (let ((limit (save-excursion (end-of-line nil) (point)))) (if (re-search-forward (concat shell-command-regexp "\\([;&|][\\s ]*\\)+") limit 'move arg) - (skip-syntax-backward "^\\s ")))) + (skip-syntax-backward " ")))) (defun shell-backward-command (&optional arg) @@ -597,11 +597,13 @@ See `shell-command-regexp'." See `shell-command-regexp'." (interactive "p") (let ((limit (save-excursion (comint-bol nil) (point)))) - (skip-syntax-backward "\\s " limit) + (if (> limit (point)) + (save-excursion (beginning-of-line) (setq limit (point)))) + (skip-syntax-backward " " limit) (if (re-search-backward (format "[;&|]+[\\s ]*\\(%s\\)" shell-command-regexp) limit 'move arg) (progn (goto-char (match-beginning 1)) - (skip-syntax-backward "^\\s "))))) + (skip-chars-forward ";&|"))))) (defun shell-get-current-command () |