如何在 Emacs Lisp 中访问当前区域的内容?

人气:266 发布:2022-10-16 标签: lisp emacs region

问题描述

我想在函数中以字符串的形式访问当前区域的内容.例如:

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-substringregion-beginningregion-end 一起可以做到这一点.

buffer-substring together with region-beginning and region-end can do that.

871