isearch forward的Emacs密钥绑定

isearch forward的Emacs密钥绑定,emacs,Emacs,我在Windows7上使用EmacsV24.3。我正在尝试学习如何重新映射密钥绑定 我在主目录中创建了一个.emacs文件,其中包含一行: (global-set-key (kbd "C-f") 'isearch-forward) 我使用runemacs.exe启动Emacs。我找到一个不存在的文件,键入一些单词(单击文本开头),然后键入C-F进行查找。将显示I-search:提示,我可以增量搜索文本。到目前为止 问题是,如果假设行为与默认的isearch forward击键相同,C-s,则

我在Windows7上使用EmacsV24.3。我正在尝试学习如何重新映射密钥绑定

我在主目录中创建了一个.emacs文件,其中包含一行:

 (global-set-key (kbd "C-f") 'isearch-forward)
我使用runemacs.exe启动Emacs。我找到一个不存在的文件,键入一些单词(单击文本开头),然后键入
C-F
进行查找。将显示
I-search:
提示,我可以增量搜索文本。到目前为止

问题是,如果假设行为与默认的
isearch forward
击键相同,
C-s
,则不是。当我第二次键入
C-f
以搜索字符串的下一次出现时,唯一发生的事情是
I-search
提示符出现在小缓冲区中

我无法搜索字符串的下一次出现。此外,假定
Del
键以相反方向重复搜索。当我使用
C-f
搜索时,这种情况不会发生(尽管当我使用
C-s
搜索时会发生)


所以这个单键映射似乎打破了两件事。我映射错了吗?还是这些虫子?如果映射错误,如何将
C-f
映射到
isearch forward
命令

在您的一行中添加:

(define-key isearch-mode-map "\C-f" 'isearch-repeat-forward)
问题在于,isearch有自己的绑定,一旦启动增量搜索,这些绑定就处于活动状态。添加上面的表达式将重新映射
isearch repeat forward
的绑定


如果您对这些绑定感兴趣,可以在进行增量搜索时输入C-hb来检查完整的键映射。

不,我认为教程没有这样说。我认为您指的是章节搜索和本文:

>> Type C-s again, to search for the next occurrence of "cursor".
>> Now type `<DEL>` four times and see how the cursor moves.

If you are in the middle of an incremental search and type <DEL>, the
search "retreats" to an earlier location.  If you type <DEL> just
after you had typed C-s to advance to the next occurrence of a search
string, the <DEL> moves the cursor back to an earlier occurrence.  If
there are no earlier occurrences, the `<DEL>` erases the last character
in the search string.  For instance, suppose you have typed "c", to
search for the first occurrence of "c".  Now if you type "u", the
cursor will move to the first occurrence of "cu".  Now type <DEL>.
This erases the "u" from the search string, and the cursor moves back
to the first occurrence of "c".
>再次键入C-s,以搜索下一次出现的“游标”。
>>现在输入``四次,看看光标是如何移动的。
如果处于增量搜索和类型的中间,则
搜索“撤退”到较早的位置。如果你只是打字
在键入C-s以前进到下一次搜索后
字符串时,将光标移回先前出现的位置。如果
没有更早的出现,``删除最后一个字符
在搜索字符串中。例如,假设您键入了“c”,以
搜索第一个出现的“c”。现在,如果您键入“u”,则
光标将移动到第一个出现的“cu”。现在打字。
这将从搜索字符串中删除“u”,光标向后移动
第一次出现“c”。
不会向后搜索。它从搜索中删除一个字符 字符串,然后搜索移动到结果字符串的上一次命中(仅)。 但是
C-s
之后的第一个
不会改变搜索字符串。只是 移动到上一次点击(仅限)

教程文本没有错误,尽管可能有点难以理解
阅读如果您有改进建议,或者只是想让Emacs开发人员知道您发现它不清楚,请使用
M-x report Emacs bug

谢谢。关于
DEL
键-Emacs教程说
DEL
反向重复上一次搜索。我看到
isearch模式映射将
DEL
定义为用于删除字符的键。猜教程在这种情况下是错的吗?谢谢你的澄清。但你描述的不是我的行为。教程中说>>如果您在键入C-s后立即键入以前进到搜索字符串的下一个匹配项,则会将光标移回较早出现的可能重复的搜索字符串