projectile-find-file 如何避免文件列表里出现carriage return?

系统: windows

其实用的是 helm-projectile-find-file 和 projectile-replace-regrep之类,他们都会受carriage return的影响。projectile-find-file更接近问题根源一些

projectile-replace-regrep会因为它直接失败:

Opening input file: Invalid argument, c:/path/to/file.txt^M

projectile-find-file的结果,看起来是这样的:

image

也许有关的配置:

 ;; 这两行是否配置没有区别。不配置的话,find-program的值为"find"
 (setq find-program "path/to/cygwin_bin/find.exe")
 (setq grep-program "path/to/cygwin_bin/grep.exe")

有些项有^M,有些没有,感觉可以从这里找原因……

等十一了查查 XD

set-buffer-file-coding-system?

我的环境是:

  • project: svn目录
  • 系统: Win7中文
  • Shell: CmdProxy
  • svn.exe: TortoiseSVN自带

projectile-svn-command 默认没有过滤carriage return

"svn list -R . | grep -v '$/' | tr '\\n' '\\0'"

修改下,过滤掉即可

(setq projectile-svn-command "svn list -R . | grep -v '$/' | tr '\\n' '\\0' | tr -d '\\r'")
2 个赞

要怎样修改呢?