【发布时间】:2013-10-18 15:28:22
【问题描述】:
假设我有一个代码缓冲区(在本例中为 Python),其组织方式如下:
.. cell 1 ..
##
.. cell 2 ..
# this is a comment
### this is also a comment
.. still cell 2 ..
##
.. cell 3 (code that is indented)
字符序列## 用于分隔缓冲区中的cells(代码区域/块)。字符 # 在 Python 中开始注释,因此 ## 被语言视为注释。类似的结构可以建在例如Elisp 使用 ;; 或其他编程语言。
我想定义一个 Emacs 命令,当它被调用时,它将当前的cell(即point/cursor 当前所在的cell)定义为Emacs region(即突出显示单元格)。
如何在 Emacs 中做到这一点?
供参考:
- 类似于单元格的概念或 MATLAB 中的 code sections
- 这是一个thread,用于在 Vim 中实现此功能。
【问题讨论】: