在emacs中有应用功能到区域的行吗? [英] Is there a apply-function-to-region-lines in emacs?

查看:177
本文介绍了在emacs中有应用功能到区域的行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的很多工作涉及到搜索和删除不必要的代码行。所以我创建一个宏,然后选择所有行(Cx h),然后运行命令(apply-macro-to-region-lines) 。我设法保存该命令并将其放在我的 .emacs 文件中;我叫它 cut_it_now 。但现在我的功能不再是宏了,所以我不能再使用(apply-macro-to-region-lines)函数。
你知道在某个地方实施了(apply-function-to-region-lines)

A lot of my work involves searching and deleting unnecessary lines of code. So I create a macro, and then select all lines (C-x h) and then run the command (apply-macro-to-region-lines). I managed to save that command and placed it in my .emacs file; I called it cut_it_now. But now my function is not a macro anymore, so I can't use the (apply-macro-to-region-lines) function anymore. Do you know if there is (apply-function-to-region-lines) implemented somewhere?

非常感谢,

D

推荐答案

我同意@ Lindydancer的答案,我也补充说,可能会有一个更简单的方法来完成你的目标。例如内置函数 delete-matching-lines 。 : - )

I agree with @Lindydancer's answer, and I'd also add that there might be an easier way to accomplish your goal. e.g. the built-in function delete-matching-lines. :-)

这篇关于在emacs中有应用功能到区域的行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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