2013-10-30 55 views
2

如果我可以将选定的Emacs文本区域作为c或C++程序的输入运行,那将会很好。程序的输出可以覆盖选定的文本。有这样的功能吗?运行选择并替换

+1

拍摄,我不会想到使用单词“过滤器”... – Polymer

回答

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.