aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorRichard M. Stallman1993-12-24 05:42:58 +0000
committerRichard M. Stallman1993-12-24 05:42:58 +0000
commitb0f867435d6f6202bcdd4d4eb2986f8b3e32a3cd (patch)
tree885897bdd64570971bd30c72ac80fc18867f96dc /lisp/shell.el
parent6eb7492c5133c4f2ad633c913c7bd56947dc6377 (diff)
downloademacs-b0f867435d6f6202bcdd4d4eb2986f8b3e32a3cd.tar.gz
emacs-b0f867435d6f6202bcdd4d4eb2986f8b3e32a3cd.zip
(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.el8
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'."
597See `shell-command-regexp'." 597See `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 ()