Commit 8c05cb10 authored by Glenn Morris's avatar Glenn Morris
Browse files

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.
parent 30213927
2013-09-12 Glenn Morris <rgm@gnu.org> 2013-09-12 Glenn Morris <rgm@gnu.org>
* 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.
* dframe.el (dframe-timer-fn): * dframe.el (dframe-timer-fn):
* files.el (dir-locals-read-from-file): * files.el (dir-locals-read-from-file):
* mpc.el (mpc--status-timer-run, mpc--status-idle-timer-run) * mpc.el (mpc--status-timer-run, mpc--status-idle-timer-run)
......
...@@ -791,7 +791,7 @@ and `shell-pushd-dunique' control the behavior of the relevant command. ...@@ -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'." Environment variables are expanded, see function `substitute-in-file-name'."
(if shell-dirtrackp (if shell-dirtrackp
;; We fail gracefully if we think the command will fail in the shell. ;; 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 (let ((start (progn (string-match
(concat "^" shell-command-separator-regexp) (concat "^" shell-command-separator-regexp)
str) ; skip whitespace str) ; skip whitespace
...@@ -824,8 +824,7 @@ Environment variables are expanded, see function `substitute-in-file-name'." ...@@ -824,8 +824,7 @@ Environment variables are expanded, see function `substitute-in-file-name'."
(setq start (progn (string-match shell-command-separator-regexp (setq start (progn (string-match shell-command-separator-regexp
str end) str end)
;; skip again ;; skip again
(match-end 0))))) (match-end 0))))))))
(error "Couldn't cd"))))
(defun shell-unquote-argument (string) (defun shell-unquote-argument (string)
"Remove all kinds of shell quoting from STRING." "Remove all kinds of shell quoting from STRING."
...@@ -907,7 +906,7 @@ Environment variables are expanded, see function `substitute-in-file-name'." ...@@ -907,7 +906,7 @@ Environment variables are expanded, see function `substitute-in-file-name'."
(cond ((> num (length shell-dirstack)) (cond ((> num (length shell-dirstack))
(message "Directory stack not that deep.")) (message "Directory stack not that deep."))
((= num 0) ((= num 0)
(error (message "Couldn't cd"))) (error "Couldn't cd"))
(shell-pushd-dextract (shell-pushd-dextract
(let ((dir (nth (1- num) shell-dirstack))) (let ((dir (nth (1- num) shell-dirstack)))
(shell-process-popd arg) (shell-process-popd arg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment