2

It would be nice if I could run a selected region of Emacs text as an input for a c or c++ program. The output of the program could then overwrite the selected text. Is there a feature like this?

Polymer
  • 1,043
  • 11
  • 13

1 Answers1

2
shell-command-on-region is an interactive compiled Lisp function in
`simple.el'.

It is bound to <s-kp-bar>, s-|, M-|, <menu-bar> <tools>
<shell-on-region>.

(shell-command-on-region START END COMMAND &optional OUTPUT-BUFFER
REPLACE ERROR-BUFFER DISPLAY-ERROR-BUFFER)

Execute string COMMAND in inferior shell with region as input.
Normally display output (if any) in temp buffer `*Shell Command Output*';
Prefix arg means replace the region with it.  Return the exit code of
COMMAND.
stew
  • 11,276
  • 36
  • 49