Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shellenv recipe #829

Closed
wants to merge 1 commit into from
Closed

Add shellenv recipe #829

wants to merge 1 commit into from

Conversation

zonuexe
Copy link
Contributor

@zonuexe zonuexe commented Jun 16, 2013

No description provided.

@purcell
Copy link
Member

purcell commented Jun 16, 2013

Hmm, how is this different from my existing exec-path-from-shell package? As far as I can tell, they both provide the same functionality.

@purcell
Copy link
Member

purcell commented Jun 16, 2013

(Specifically, exec-path-from-shell-copy-env seems just like shellenv: https://github.com/purcell/exec-path-from-shell/blob/master/exec-path-from-shell.el#L142)

@zonuexe
Copy link
Contributor Author

zonuexe commented Jun 17, 2013

I thought that there should be the person of the thought same as me, but wrote shellenv because I was not able to discover it. Its original was a small cord snippet. https://gist.github.com/zonuexe/3792841

shellenv execute a shell of path which a user ordered if I give a difference with exec-path-from-shell daringly and is to be able to acquire every environment variable. (shellenv/setenv "�PAGER")

I cannot judge which script shows good performance.

@purcell
Copy link
Member

purcell commented Jun 17, 2013

Yes, exec-path-from-shell does the same thing:

(exec-path-from-shell-copy-env "PAGER")

but it also allows multiple values to be set using just a single "sh" process:

(exec-path-from-shell-copy-envs '("PATH" "MANPATH" "SSH_AUTH_SOCK" "PAGER")) ;; => Only calls "sh" once

Additionally, shellenv fails in the following case:

export FOO1="FOO\nBAR"

then

(shellenv/.getenv "FOO1") ; => "FOO\\nBAR"

so the newline wasn't preserved.

If it's possible for you to use exec-path-from-shell, I think it would be less confusing for users than to introduce a second similar library.

@purcell
Copy link
Member

purcell commented Jun 18, 2013

Hey @syohex and @tom-tan, you've presumably seen both shellenv and exec-path-from-shell: any comments on this discussion?

@tom-tan
Copy link
Contributor

tom-tan commented Jun 18, 2013

Hi @purcell and @zonuexe,

I find that exec-path-from-shell does not customize the shell to get PATH.
Is it possible to customize it?
Some people uses different shells inside/outside GNU screen.

@purcell
Copy link
Member

purcell commented Jun 18, 2013

Yes, that customisation would be easy to provide.

But in fact, if you use a different shell from within Emacs, you should probably just (setenv "SHELL" "/bin/someshell"), in which case exec-path-from-shell will do the right thing.

-Steve

@syohex
Copy link
Contributor

syohex commented Jun 18, 2013

@purcell I think exec-path-from-shell is better than shellenv.
exec-path-from-shell provides all feature of shellenv and exec-path-from-shell has
good documentation.

@milkypostman
Copy link
Member

Going to close this. Re-open if anyone is pissed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants