情况是这样的:在dired中无法使用swiper,经查看swiper是调用的dired-isearch-filename,这
个函数是隶属于 =dired-aux.el= 这个包的,但是如果不手动加载这个包就不能使用
dired-isearch-filname,报错内容:
#+BEGIN_QUOTE
Symbol’s value as variable is void: dired-isearch-filenames
#+END_QUOTE
emacs版本25.3.1
所有的包都是最新的,截止今日。
(setq dired-isearch-filenames 'dwim)
谢谢大佬帮助 ,我看来下dwim这个值的含义:
If ‘dwim’, Isearch matches file names when initial point position is on a file name. Otherwise, it searches the whole buffer without restrictions.
~翻译过来~
如果设置值为 ‘dwim’ , 那么当Isearch初始点位置在一个文件名上时它搜索文件名. 除了上述情况,它没有任何 限制的查找整个buffer的内容.
我想问的是这个初始点位置是什么?? 光标??
如果是光标的话,那么我一不小心把光标放在了一个文件名上,但是我想找文件夹,那么是不是搜索不出来了?
swiper不会提取光标所在内容作为搜索的
这里,我试了一下,只要dired-isearch-filenames为t,dired都可以使用swiper的
1 个赞