summaryrefslogtreecommitdiff
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-09-11 22:40:50 -0700
committerGlenn Morris <rgm@gnu.org>2013-09-11 22:40:50 -0700
commit8c05cb1082e51eb6367fba2f5dc0115113b6c2a1 (patch)
tree45850dd3fa904e3413d8f2527b252621a5ab256b /lisp/shell.el
parent30213927b6eebe291cd425d5863f54bffe0b8a83 (diff)
downloademacs-8c05cb1082e51eb6367fba2f5dc0115113b6c2a1.tar.gz
Fix some minor shell.el oddness related to usage of error and message
* lisp/shell.el (shell-directory-tracker): Output error as a message rather than just returning it as a string. (shell-process-pushd): Remove useless use of message.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 387d1057bd4..2047543f288 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -791,7 +791,7 @@ and `shell-pushd-dunique' control the behavior of the relevant command.
Environment variables are expanded, see function `substitute-in-file-name'."
(if shell-dirtrackp
;; We fail gracefully if we think the command will fail in the shell.
- (condition-case nil
+ (with-demoted-errors "Couldn't cd: %s"
(let ((start (progn (string-match
(concat "^" shell-command-separator-regexp)
str) ; skip whitespace
@@ -824,8 +824,7 @@ Environment variables are expanded, see function `substitute-in-file-name'."
(setq start (progn (string-match shell-command-separator-regexp
str end)
;; skip again
- (match-end 0)))))
- (error "Couldn't cd"))))
+ (match-end 0))))))))
(defun shell-unquote-argument (string)
"Remove all kinds of shell quoting from STRING."
@@ -907,7 +906,7 @@ Environment variables are expanded, see function `substitute-in-file-name'."
(cond ((> num (length shell-dirstack))
(message "Directory stack not that deep."))
((= num 0)
- (error (message "Couldn't cd")))
+ (error "Couldn't cd"))
(shell-pushd-dextract
(let ((dir (nth (1- num) shell-dirstack)))
(shell-process-popd arg)