管道emacs shell输出到一个新的缓冲区 [英] Pipe emacs shell output to a new buffer

查看:127
本文介绍了管道emacs shell输出到一个新的缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我想要输入以下内容:

  $ 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 if resize-mini-windows is non-nil), it is shown there. Otherwise, the buffer containing the output is displayed.

这篇关于管道emacs shell输出到一个新的缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆