branch: elpa/exec-path-from-shell
commit 900d98a912300247685250a67185d974cd32b4f7
Author: Sebastian Wiesner <[email protected]>
Commit: Sebastian Wiesner <[email protected]>
Improve docstrings
---
exec-path-from-shell.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index f68251cfc3..c507a750b0 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -57,6 +57,10 @@
;;; Code:
(defun exec-path-from-shell-getenv (name)
+ "Get the environment variable NAME from the user's shell.
+
+Execute $SHELL as interactive login shell, have it output the
+variable of NAME and return this output as string."
(with-temp-buffer
(call-process (getenv "SHELL") nil (current-buffer) nil
"--login" "-i" "-c" (concat "echo __RESULT=$" name))
@@ -65,13 +69,15 @@
;;;###autoload
(defun exec-path-from-shell-copy-env (name)
- "Set the environment variable with `NAME' to match the value seen in the
user's shell."
+ "Set the environment variable $NAME from the user's shell.
+
+Return the value of the environment variable."
(interactive "sCopy value of which environment variable from shell? ")
(setenv name (exec-path-from-shell-getenv name)))
;;;###autoload
(defun exec-path-from-shell-initialize ()
- "Set the PATH environment variable and `exec-path' to match that seen in the
user's shell."
+ "Set $PATH and `exec-path' from the user's shell."
(interactive)
(let ((path-from-shell (exec-path-from-shell-getenv "PATH")))
(setenv "PATH" path-from-shell)