New answers tagged


Does Emacs 25.1.1 not have async-shell-command? Per the docstring, Like ‘shell-command’, but adds ‘&’ at the end of COMMAND to execute it asynchronously. It is bound to M-& by default.


Right, Commands such as (shell-command "xclip -selection clipboard -o") hang unless the clipboard has the "right" content either text or image. As a workaround, you can terminate it by using timeout TIMEOUT. An example: When only plain text exists in the clipboard and you use (shell-command (format "xclip -selection clipboard -t ...


You can use the per-command setting of the encoding that @choroba mentions in his comment (C-x RET c utf-8) which will only affect the next command, but you can also set UTF-8 to be the default encoding everywhere. Add (set-language-environment "UTF-8") to your init file and restart emacs. Or for the current session, click on "Options/...


(buffer-file-name) returns the full pathname of the file visited in the current buffer but that is NOT the name of the buffer, so the output is saved in a different buffer. The name of the current buffer is returned by calling the function buffer-name. But the doc string for shell-command says: The optional second argument OUTPUT-BUFFER, if non-nil, ...

Top 50 recent answers are included