diff options
Diffstat (limited to 'lisp/shell.el')
| -rw-r--r-- | lisp/shell.el | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index 3ca2564b65c..2047543f288 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | ;;; shell.el --- specialized comint.el for running the shell -*- lexical-binding: t -*- | 1 | ;;; shell.el --- specialized comint.el for running the shell -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1988, 1993-1997, 2000-2013 Free Software Foundation, | 3 | ;; Copyright (C) 1988, 1993-1997, 2000-2013 Free Software Foundation, Inc. |
| 4 | ;; Inc. | ||
| 5 | 4 | ||
| 6 | ;; Author: Olin Shivers <shivers@cs.cmu.edu> | 5 | ;; Author: Olin Shivers <shivers@cs.cmu.edu> |
| 7 | ;; Simon Marshall <simon@gnu.org> | 6 | ;; Simon Marshall <simon@gnu.org> |
| @@ -792,7 +791,7 @@ and `shell-pushd-dunique' control the behavior of the relevant command. | |||
| 792 | Environment variables are expanded, see function `substitute-in-file-name'." | 791 | Environment variables are expanded, see function `substitute-in-file-name'." |
| 793 | (if shell-dirtrackp | 792 | (if shell-dirtrackp |
| 794 | ;; We fail gracefully if we think the command will fail in the shell. | 793 | ;; We fail gracefully if we think the command will fail in the shell. |
| 795 | (condition-case nil | 794 | (with-demoted-errors "Couldn't cd: %s" |
| 796 | (let ((start (progn (string-match | 795 | (let ((start (progn (string-match |
| 797 | (concat "^" shell-command-separator-regexp) | 796 | (concat "^" shell-command-separator-regexp) |
| 798 | str) ; skip whitespace | 797 | str) ; skip whitespace |
| @@ -825,8 +824,7 @@ Environment variables are expanded, see function `substitute-in-file-name'." | |||
| 825 | (setq start (progn (string-match shell-command-separator-regexp | 824 | (setq start (progn (string-match shell-command-separator-regexp |
| 826 | str end) | 825 | str end) |
| 827 | ;; skip again | 826 | ;; skip again |
| 828 | (match-end 0))))) | 827 | (match-end 0)))))))) |
| 829 | (error "Couldn't cd")))) | ||
| 830 | 828 | ||
| 831 | (defun shell-unquote-argument (string) | 829 | (defun shell-unquote-argument (string) |
| 832 | "Remove all kinds of shell quoting from STRING." | 830 | "Remove all kinds of shell quoting from STRING." |
| @@ -908,7 +906,7 @@ Environment variables are expanded, see function `substitute-in-file-name'." | |||
| 908 | (cond ((> num (length shell-dirstack)) | 906 | (cond ((> num (length shell-dirstack)) |
| 909 | (message "Directory stack not that deep.")) | 907 | (message "Directory stack not that deep.")) |
| 910 | ((= num 0) | 908 | ((= num 0) |
| 911 | (error (message "Couldn't cd"))) | 909 | (error "Couldn't cd")) |
| 912 | (shell-pushd-dextract | 910 | (shell-pushd-dextract |
| 913 | (let ((dir (nth (1- num) shell-dirstack))) | 911 | (let ((dir (nth (1- num) shell-dirstack))) |
| 914 | (shell-process-popd arg) | 912 | (shell-process-popd arg) |
| @@ -1015,12 +1013,11 @@ command again." | |||
| 1015 | ds)) | 1013 | ds)) |
| 1016 | (setq i (match-end 0))) | 1014 | (setq i (match-end 0))) |
| 1017 | (let ((ds (nreverse ds))) | 1015 | (let ((ds (nreverse ds))) |
| 1018 | (condition-case nil | 1016 | (with-demoted-errors "Couldn't cd: %s" |
| 1019 | (progn (shell-cd (car ds)) | 1017 | (shell-cd (car ds)) |
| 1020 | (setq shell-dirstack (cdr ds) | 1018 | (setq shell-dirstack (cdr ds) |
| 1021 | shell-last-dir (car shell-dirstack)) | 1019 | shell-last-dir (car shell-dirstack)) |
| 1022 | (shell-dirstack-message)) | 1020 | (shell-dirstack-message))))) |
| 1023 | (error (message "Couldn't cd")))))) | ||
| 1024 | (if started-at-pmark (goto-char (marker-position pmark))))) | 1021 | (if started-at-pmark (goto-char (marker-position pmark))))) |
| 1025 | 1022 | ||
| 1026 | ;; For your typing convenience: | 1023 | ;; For your typing convenience: |