ido中的空格路径(查找文件)(在MS Windows上)

时间:2009-10-12 19:22:29

标签: emacs ido-mode

我在Windows机器上运行GNU Emacs 23,并且在ido-find-file匹配包含空格的文件时遇到问题。

在我的.emacs中我(setq ido-use-filename-at-point t),并希望在点击"D:\Dokumente und Einstellungen\Username\Eigene Dateien\Scratch\ipswitch.bat"时匹配C-x C-f这样的字符串。

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

我想要整个字符串(可能限于某些模式(如org-mode),如果有必要)进行匹配和建议。

我怎么能让它工作?

1 个答案:

答案 0 :(得分:0)

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

我在Windows上使用具有ido-mode的Gnu Emacs,并且在更改迷你缓冲区完成映射时感到高兴:

;; 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-mode建议C:/Documents and Settings/