如何在 Emacs Lisp 中访问当前区域的内容? [英] How do I access the contents of the current region in Emacs Lisp?
本文介绍了如何在 Emacs Lisp 中访问当前区域的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在函数中以字符串的形式访问当前区域的内容.例如:
I want to access the contents of the current region as a string within a function. For example:
(concat "stringa" (get-region-as-string) "stringb")
谢谢
埃德
推荐答案
buffer-substring
与 region-beginning
和 region-end
一起可以做到这一点.
buffer-substring
together with region-beginning
and region-end
can do that.
这篇关于如何在 Emacs Lisp 中访问当前区域的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文