0

When I run M-! enter shell command enter in org mode, I expect the output to be inserted into the buffer I have active.

Instead, emacs opens a second buffer (splitting the window in two) and inserts the output there. How can I make it insert the result in the buffer I am working?

2 Answers 2

4

This is the normal behaviour for shell-command.

If you want the output inserted into the current buffer, you must supply an argument (like C-u M-!).

3

You can do that by typing C-u M-! command RET. Checking the help on M-! explains why it works.

M-! runs the command shell-command, which is an interactive compiled Lisp function in `simple.el'. It is bound to s-L, M-!, <menu-bar> <tools> <shell>. (shell-command COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER) Execute string COMMAND in inferior shell; display output, if any. With prefix argument, insert the COMMAND's output at point. 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.