purcell / exec-path-from-shell

Make Emacs use the $PATH set up by the user's shell
Other
1.41k stars 81 forks source link

Set each instance of the buffer local variable eshell-path-env #101

Closed mnewt closed 3 years ago

mnewt commented 3 years ago

This changes the function exec-path-from-shell-setenv to set the value of eshell-path-env in each existing Eshell buffer. This is because eshell-path-env is a buffer local variable.

To me this seems like expected behavior--that we would be changing all instances of the variable.

However, it could be surprising to people who expect exec-path-from-shell to not affect running shells.

What does everyone think? Is this a good change to make?

purcell commented 3 years ago

Probably the right thing to do here would be to just use setq-default, no? Then, buffers which haven't actively overridden the default value locally will see the new, updated default.

mnewt commented 3 years ago

@purcell you're right. Now the only change in this PR is to use setq-default on eshell-path-env, instead of setq. How's that?

purcell commented 3 years ago

Perfect, thank you.