changeset 5335:abf0d4d01681

(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.
author Richard M. Stallman <rms@gnu.org>
date Fri, 24 Dec 1993 05:42:58 +0000
parents 37ea8707b175
children 4521917cdd6e
files lisp/shell.el
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/shell.el	Fri Dec 24 04:38:03 1993 +0000
+++ b/lisp/shell.el	Fri Dec 24 05:42:58 1993 +0000
@@ -589,7 +589,7 @@
   (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'."
   (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 ()