Function: shell-backward-command
shell-backward-command is an interactive and byte-compiled function
defined in shell.el.gz.
Signature
(shell-backward-command &optional ARG)
Documentation
Move backward across ARG shell command(s). Does not cross lines.
See shell-command-regexp.
Probably introduced at or before Emacs version 19.23.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/shell.el.gz
(defun shell-backward-command (&optional arg)
"Move backward across ARG shell command(s). Does not cross lines.
See `shell-command-regexp'."
(interactive "p")
(let ((limit (save-excursion (comint-bol nil) (point))))
(when (> limit (point))
(setq limit (line-beginning-position)))
(skip-syntax-backward " " limit)
(let ((pt (point)))
(if (re-search-backward
(format "[;&|]+[\t ]*\\(%s\\)" shell-command-regexp) limit 'move arg)
(progn (goto-char (match-beginning 1))
(skip-chars-forward ";&|")))
(and (/= pt (point))
(skip-syntax-forward " " pt)))))