Closed Montana closed 4 months ago
Sorry but I have no idea about much of what you wrote there. I assume you're talking about an Emacs plugin of some sort? I don't maintain that nor is it in this repository. I also have no clue what format-all
is.
Hey all,
I came across a similar discussion regarding this issue. It appears that
format-all
prioritizes theSHELL
environment variable (which is configured tozsh
) over the current buffer'ssh-shell
setting. When I changed theSHELL
environment tobash
usingSHELL=bash doom env
and then reloaded, the formatter started recognizingbash
, moving away from its previouszsh
default. To test this further, I added (message"SHELL: %s" sh-shell
) to theformat-all--buffer-hard
function. Interestingly, even though my current buffer'ssh-shell
was set to bash,format-all
still opted forzsh
.I'm thinking the way
format-all
is implemented could inherently give precedence to system-wide settings (like environment variables) over Emacs buffer-local variables. This could be an oversight or a deliberate design decision based on the tool's intended use cases, I understand this behavior ensures faster operation but at the cost of flexibility in specific scenarios.The next idea was feasibly that the logic within
format-all
for detecting theshell
might not be robust enough to handle cases where the buffer'sshell
differs from the system's defaultshell
. I'm aware Doom Emacs aggressively caches environment variables for performance and simplicity, which might cause this issue.It's also feasible that this behavior might even serve as a safeguard, with
format-all
defaulting to system-wide configurations in instances where it faces challenges in accurately identifying or implementingbuffer-local
settings, thus guaranteeing operation within a consistent environment.Steps to reproduce:
M-x sh-set-shell
and selectbash
.Any help would be greatly appreciated. I thank you for your time.
Cheers, Michael Mendy