[英]Error in Dired sorting on Windows (with Cygwin Emacs)
In a Cygwin Emacs on Windows, in Dired, if I try to sort by time (for example), I get the error: 在Windows上的Cygwin Emacs中,在Dired中,如果我尝试按时间排序(例如),则会收到错误消息:
insert-directory: Listing directory failed but `access-file' worked
In a Windows Emacs binary on Windows, I do not have any problem, but Emacs uses its own implementation of ls
IIUC. 在Windows上的Windows Emacs二进制文件中,我没有任何问题,但是Emacs使用自己的ls
IIUC实现。
What I don't understand is that Cygwin ls
DOES understand options such as --dired
and -t
(to sort by modification time). 我不了解的是Cygwin ls
确实了解--dired
和-t
类的选项(按修改时间排序)。
My current config: 我当前的配置:
;; Switches passed to `ls' for Dired.
(setq dired-listing-switches
(cond ((eq system-type 'windows-nt) ; Native Windows version of Emacs.
"-a -F -l")
(t ; Cygwin version of Emacs or ...
"-a -F --group-directories-first -l --time-style=long-iso")))
Try setting dired-listing-switches
to "-aFl"
instead of "-a -F -l"
. 尝试将dired-listing-switches
设置为"-aFl"
而不是"-a -F -l"
。 Maybe that will make some difference (but it does not change anything for me). 也许那会有所作为(但对我来说并没有任何改变)。
What is your value of ls-lisp-use-insert-directory-program
? ls-lisp-use-insert-directory-program
什么? If it is non- nil
try setting it to nil
, so that you use ls-lisp instead of Cygwin's ls
. 如果不是nil
尝试将其设置为nil
,以便使用ls-lisp而不是Cygwin的ls
。 (At least do that as a trial, and maybe you will want to stick with that.) (至少是作为试用版进行的,也许您会坚持这样做。)
what is your value of option ls-lisp-emulation
? 选项ls-lisp-emulation
价值是什么? If it is something else, try customizing it to MS-Windows
. 如果还有其他问题,请尝试将其自定义为MS-Windows
。 (Be sure to read Ch v
for this option - eg, use Customize.) (请务必阅读此选项的Ch v
例如,使用Customize。)
In sum, I suggest that you first try getting Dired to work OK using ls-lisp and not Cygwin's ls
. 总之,我建议您首先尝试使用ls-lisp而不是Cygwin的ls
使Dired正常工作。 That will at least give you a solid Dired to work with. 至少会给您扎实的Dired工作。 If you like, you can then still pursue tackling your problem as stated, ie, to get it working with Cygwin Emacs. 如果愿意,您仍然可以按照说明解决问题,即与Cygwin Emacs一起使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.