2009-10-12 87 views
1

我在Windows机器上运行GNU Emacs 23,并遇到ido-find-file与包含空格的文件相匹配的问题。在ido(find-file)中有空格的路径(在MS Windows上)

在我的.emacs I (setq ido-use-filename-at-point t)中,当匹配C-x C-f时,想匹配一个字符串,如"D:\Dokumente und Einstellungen\Username\Eigene Dateien\Scratch\ipswitch.bat"

当点位于"D:\之间时,IDO建议d:/Dokumente[Dokumente und Einstellungen],即模式“空白”在空格上。

我想整个字符串(可能只限于某些模式(如组织模式)(如果需要的话))进行匹配和建议。

我怎么能得到那个工作?

回答

0

我还没有找到ffap/thingatpt的解决方案,但对于ido模式,init.el中的以下代码可以创造奇迹。

我在Windows上使用GNU Emacs的与IDO模式,并已发现的喜悦中改变迷你缓冲区完成图:

;; EXPERIMENTAL: unbind SPACE and ? in minibuffer, to allow typing in completions with those chars 
(add-hook 'minibuffer-setup-hook (lambda() 
            (define-key minibuffer-local-completion-map " " nil) 
            (define-key minibuffer-local-must-match-map " " nil) 
            (define-key minibuffer-local-completion-map "?" nil) 
            (define-key minibuffer-local-must-match-map "?" nil))) 

的评论警告说,它是“实验”这样我就可以的情况下,我曾经扭转它遇到奇怪的行为。但是我已经用了一年多了,没有任何问题。

现在,当我做C-x C-f C:/Doc

IDO模式表明C:/Documents and Settings/

+0

这不正是我想要的 - 但作品足够好。谢谢! – steglig 2011-03-21 19:01:28