求助:emacs 如何查找特殊字符?

C-s 进入查找模式后,.可以匹配任意字符,但如果想查找.本身的时候如何不让他进行任意匹配?

你自己装了奇怪的东西, 建议自己的配置自己调.

默认 C-s 是 isearch, 没有正则表达式.

在 regexp 中用 \ escape 特殊字符,如用 \. 搜索 . 本身。


如楼上所说,C-s 初始状态不是 regexp,C-M-s 才是,在 isearch 中间用

Type M-s r to toggle regular-expression mode

C-s runs the command isearch-forward (found in global-map), which is an 
interactive compiled Lisp function in ‘isearch.el’.

(isearch-forward &optional REGEXP-P NO-RECURSIVE-EDIT) 

奇了怪了. .确实被用来匹配任意字符

试了,\对除了.之外的其他字符都有效,但就是对.无效。

怎么可能?C-M-s \. 搜索到了四个点:

同样可以找到:

(string-match "\\." "foo.bar.baz")
;; => 3

我这里好像怎么弄都不行

下面的链接是录屏:

https://asciinema.org/a/HBhpIyQgvdZONHUJ7B4Nrl4hq

Emacs -Q 肯定没问题,你用了 pyim-isearch,从名字上看显然会对 isearch 影响,把它关了再试一试

谢谢,果然是pyim-isearch的问题