关于emacs 删除选定区域的问题 及其他

Vim、Emacs配置和使用
回复
formylove2
帖子: 105
注册时间: 2008-11-03 10:06

关于emacs 删除选定区域的问题 及其他

#1

帖子 formylove2 » 2009-07-15 20:14

问题1:我用鼠标在emacs 缓冲区中 选定(会高亮)一段 然后按 删除 键(键盘上的backspace) 可以删除 这段选定区域

但我用 mark-set 选定(也会高亮选定区域)一个区域 然后按 backspace却只是删除光标最后所在位置的前面一个字符

怎么会这样?why?

问题2:我在一次交换上下行的操作时 (C-x C-t) 偶然发现 用 M+上 下 键 可以拖动这一整行 上下移动 但过了段时间后 M+上 下 无效了

怎么会这样 ?why?

问题3:此问题与问题1有联系 比如 一段大写字母 我试图用M+l 将其改为小写 但只用用鼠标选定时(会高亮)才能起作用 用纯键盘操作 既 mark-set 然后选定 然后再M+l 却无法起作用 往往是 光标最后所在位置的前面一个字符变为小写了


希望有高手能解答下
yupeng820921
帖子: 94
注册时间: 2009-02-25 19:44

Re: 关于emacs 删除选定区域的问题 及其他

#2

帖子 yupeng820921 » 2009-07-16 11:19

1 .emacs: (delete-selection-mode 1)
formylove2
帖子: 105
注册时间: 2008-11-03 10:06

Re: 关于emacs 删除选定区域的问题 及其他

#3

帖子 formylove2 » 2009-07-16 17:05

Toggle Delete Selection mode.
With prefix ARG, turn Delete Selection mode on if ARG is positive, off if ARG is not positive.
触发删除选择模式

When Delete Selection mode is enabled, Transient Mark mode is also enabled and typed text replaces the selection if the selection is active.
Otherwise, typed text is just inserted at point regardless of any selection. 否则 输入文本无论怎么选择都被作为插入点 ?

谢2楼! 不知道你是怎么知道这个的

具体似乎 emacs 将 mark 弄成两种状态了 一种是选择点 还有一个是 选择中的文字 不知道这样设计 有何意义
yupeng820921
帖子: 94
注册时间: 2009-02-25 19:44

Re: 关于emacs 删除选定区域的问题 及其他

#4

帖子 yupeng820921 » 2009-07-16 17:56

我是在emacs FAQ里面看到的。

C-h i进入info,C-s搜索 emacs FAQ。然后进入第五项 5 Common requests,其中有一条Replacing highlighted text。

其他的我就不晓得了。
herberteuler
帖子: 45
注册时间: 2007-01-27 14:11

Re: 关于emacs 删除选定区域的问题 及其他

#5

帖子 herberteuler » 2009-07-21 17:39

M-<up> 和 M-<down> 指的是 org-metaup 和 org-metadown 吧? 那个只在 org mode 里有用的.
formylove2
帖子: 105
注册时间: 2008-11-03 10:06

Re: 关于emacs 删除选定区域的问题 及其他

#6

帖子 formylove2 » 2009-07-27 14:17

恩 可惜ORG 模式 不适合其他模式 比如编程操作

哈 3个问题都解决了 谢各位大虾
回复