branch: elpa/exec-path-from-shell
commit bb20b46f6afc8994cb66a9a4d29146f7dcb8b3b3
Author: Steve Purcell <[email protected]>
Commit: Steve Purcell <[email protected]>
Treat csh like tcsh (closes #29)
Also see #28
---
exec-path-from-shell.el | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index 98be4835d3..b8754fbe1f 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -89,16 +89,10 @@
"Double-quote S, escaping any double-quotes already contained in it."
(concat "\"" (replace-regexp-in-string "\"" "\\\\\"" s) "\""))
-(defun exec-path-from-shell--tcsh-p (shell)
- "Return non-nil if SHELL appears to be tcsh."
- (and shell (string-match "tcsh$" shell)))
-
-(defun exec-path-from-shell--login-arg (shell)
- "Return the name of the --login arg for SHELL."
- (if (exec-path-from-shell--tcsh-p shell) "-d" "-l"))
-
(defcustom exec-path-from-shell-arguments
- (list (exec-path-from-shell--login-arg (getenv "SHELL")) "-i")
+ (if (string-match-p "t?csh$" (getenv "SHELL"))
+ (list "-d")
+ (list "-l" "-i"))
"Additional arguments to pass to the shell.
The default value denotes an interactive login shell."
@@ -112,7 +106,7 @@ The default value denotes an interactive login shell."
(defun exec-path-from-shell--standard-shell-p (shell)
"Return non-nil iff SHELL supports the standard ${VAR-default} syntax."
- (not (string-match "\\(fish\\|tcsh\\)$" shell)))
+ (not (string-match "\\(fish\\|t?csh\\)$" shell)))
(defun exec-path-from-shell-printf (str &optional args)
"Return the result of printing STR in the user's shell.