管道emacs shell输出到一个新的缓冲区 [英] Pipe emacs shell output to a new buffer
问题描述
$ git diff | tempbuffer
并在新的未保存的缓冲区中打开差异。
您可以使用 M - ! - 它将在与shell缓冲区相同的cwd内运行命令,并输出结果为 * Shell命令输出*
缓冲区。
请注意,如果结果很简短,该缓冲区不会被提升,输出将被复制到回波区;但是缓冲区仍然是可用的。 ch f shell-command
RET 具有什么构成简要输出的详细信息:
如果输出足够短以在回显区域显示
(由变量max -mini-window-height
如果
resize-mini-windows
是非零),它显示在那里。
否则显示包含输出的缓冲区。
For example, I want to be able to type something like:
$ git diff | tempbuffer
and have the diff opened in a new, unsaved buffer.
You can just use M-! -- it will run the command within the same cwd as your shell buffer, and output the results to a *Shell Command Output*
buffer.
Note that if the results are brief, that buffer will not be raised and the output will be copied to the echo area; however the buffer is still used and available. C-hf shell-command
RET has details of what constitutes "brief" output:
If the output is short enough to display in the echo area (determined by the variable
max-mini-window-height
ifresize-mini-windows
is non-nil), it is shown there. Otherwise, the buffer containing the output is displayed.
这篇关于管道emacs shell输出到一个新的缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!