The error is raised by shell-command--shell-command-with-editor-mode. But further stack trace is obfuscated by bytecompiled output. Recently I had to set

(setq explicit-shell-file-name "bash")

to be able to run M-xshell (it would give a similar error). I think this may be related, but I cannot find what exactly is broken.

This is Ubuntu 16.04.

  • If you use M-x toggle-debug-on-error, trigger the problem again, and include the backtrace in your question, it might be easier for someone to help you figure out what's going on.
    – stevoooo
    May 14, 2017 at 17:55
  • You can also tell Emacs to load the uncompiled versions of the compiled libraries in question, which might (depending on what the compiled code is) help to produce a clearer backtrace.
    – phils
    May 15, 2017 at 0:45
  • @phils in this case it won't help because it funcalls the bytecompiled code, which it gets from elsewhere at runtime. I could probably track it down, but I was just hoping someone could recognize the symptoms without having to dive in. It's really odd that stock version of Emacs wouldn't work properly on a stock version of Ubuntu...
    – wvxvw
    May 15, 2017 at 4:16

1 Answer 1


OK, found the problem: I also had to set shell-file-name to something other than /bin/sh, because Ubuntu ships with Dash as sh and Emacs relies on non-standard GNU features present in Bash, but not Dash.

  • Could you say which features those are? (and where is the Emacs code that uses them?)
    – npostavs
    May 15, 2017 at 15:00
  • @npostavs I found some reference to $ESHEL environment variable, but I stopped there, it's not the only one missing.
    – wvxvw
    May 15, 2017 at 15:19
  • Hmm, that doesn't sound like a bash feature...
    – npostavs
    May 15, 2017 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.