]> code.delx.au - gnu-emacs/blobdiff - lisp/shell.el
Update docs for `customize-mode'
[gnu-emacs] / lisp / shell.el
index 480d04a03ebeaac30c545fa54199223f3b3090db..1f019f20f3a63a708c6f1d6695e464943834791e 100644 (file)
@@ -1,6 +1,7 @@
 ;;; shell.el --- specialized comint.el for running the shell -*- lexical-binding: t -*-
 
-;; Copyright (C) 1988, 1993-1997, 2000-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1993-1997, 2000-2016 Free Software Foundation,
+;; Inc.
 
 ;; Author: Olin Shivers <shivers@cs.cmu.edu>
 ;;     Simon Marshall <simon@gnu.org>
@@ -82,8 +83,8 @@
 ;; tab     completion-at-point         Complete filename/command/history
 ;; m-?     comint-dynamic-list-filename-completions
 ;;                                     List completions in help buffer
-;; m-c-f   shell-forward-command       Forward a shell command
-;; m-c-b   shell-backward-command      Backward a shell command
+;; c-c c-f shell-forward-command       Forward a shell command
+;; c-c c-b shell-backward-command      Backward a shell command
 ;;        dirs                         Resync the buffer's dir stack
 ;;        shell-dirtrack-mode          Turn dir tracking on/off
 ;;         comint-strip-ctrl-m         Remove trailing ^Ms from output
@@ -308,13 +309,6 @@ for Shell mode only."
                 (const :tag "on" t))
   :group 'shell)
 
-(defcustom shell-display-buffer-actions display-buffer-base-action
-  "The `display-buffer' actions for the `*shell*' buffer."
-  :type display-buffer--action-custom-type
-  :risky t
-  :version "25.1"
-  :group 'shell)
-
 (defvar shell-dirstack nil
   "List of directories saved by pushd in this buffer's shell.
 Thus, this does not include the shell's current directory.")
@@ -725,7 +719,7 @@ Otherwise, one argument `-i' is passed to the shell.
 
   ;; The buffer's window must be correctly set when we call comint (so
   ;; that comint sets the COLUMNS env var properly).
-  (pop-to-buffer buffer shell-display-buffer-actions)
+  (pop-to-buffer buffer)
   (unless (comint-check-proc buffer)
     (let* ((prog (or explicit-shell-file-name
                     (getenv "ESHELL") shell-file-name))
@@ -1098,10 +1092,12 @@ Copy Shell environment variable to Emacs: ")))
   "Move forward across ARG shell command(s).  Does not cross lines.
 See `shell-command-regexp'."
   (interactive "p")
-  (let ((limit (line-end-position)))
-    (if (re-search-forward (concat shell-command-regexp "\\([;&|][\t ]*\\)+")
-                          limit 'move arg)
-       (skip-syntax-backward " "))))
+  (let ((limit (line-end-position))
+       (pt (point)))
+    (re-search-forward (concat shell-command-regexp "\\([;&|][\t ]*\\)+")
+                      limit 'move arg)
+    (and (/= pt (point))
+        (skip-syntax-backward " " pt))))
 
 
 (defun shell-backward-command (&optional arg)
@@ -1112,10 +1108,13 @@ See `shell-command-regexp'."
     (when (> limit (point))
       (setq limit (line-beginning-position)))
     (skip-syntax-backward " " limit)
-    (if (re-search-backward
-        (format "[;&|]+[\t ]*\\(%s\\)" shell-command-regexp) limit 'move arg)
-       (progn (goto-char (match-beginning 1))
-              (skip-chars-forward ";&|")))))
+    (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)))))
 
 (defun shell-dynamic-complete-command ()
   "Dynamically complete the command at point.