不知不觉开了200+个文件

然后就 apply: Creating process pipe: Too many open files

能设置开更多点吗?

我刚刚试着打开了 570 个文件,也没遇到问题。我不觉得 Emacs 会限制打开文件的数量,好比操作系统通常也不会管用户开了多少个程序一样。

“Creating process pipe:” 应该不是指用户打开文件操作,相应的 "Too many open files` 可能也与字面意思不同。试一试查看 Backtrace (M-x toggle-debug-on-error)。

什么系统 ,linux Mac 下 可以用ulimit -n 来查看系统准许一个进程最多打开多少个文件, 通常是1024

pipe像是调用了子进程,我感觉像是打开一个buffer就触发某个机制开了一个子进程,然后就这样了。。。一点猜测:joy:

Debugger entered–Lisp error: (file-error “Creating process pipe” “Too many open files”) call-process(“git” nil (t nil) nil “–no-pager” “–literal-pathspecs” “-c” “core.preloadindex=true” “symbolic-ref” “–short” “HEAD”) apply(call-process “git” nil (t nil) nil ("–no-pager" “–literal-pathspecs” “-c” “core.preloadindex=true” “symbolic-ref” “–short” “HEAD”)) process-file(“git” nil (t nil) nil “–no-pager” “–literal-pathspecs” “-c” “core.preloadindex=true” “symbolic-ref” “–short” “HEAD”) apply(process-file (“git” nil (t nil) nil “–no-pager” “–literal-pathspecs” “-c” “core.preloadindex=true” “symbolic-ref” “–short” “HEAD”)) magit-process-file(“git” nil (t nil) nil “–no-pager” “–literal-pathspecs” “-c” “core.preloadindex=true” “symbolic-ref” “–short” “HEAD”) apply(magit-process-file “git” nil (t nil) nil ("–no-pager" “–literal-pathspecs” “-c” “core.preloadindex=true” “symbolic-ref” “–short” “HEAD”)) magit-git-insert(“symbolic-ref” “–short” “HEAD”) apply(magit-git-insert (“symbolic-ref” “–short” “HEAD”)) magit-git-string(“symbolic-ref” “–short” “HEAD”) magit-get-current-branch() magit-pull-format-branchrebase() magit-popup-format-variable-button(magit-popup-variable-button [cl-struct-magit-popup-event 114 “branch.%s.rebase” magit-pull-format-branchrebase magit-cycle-branchrebase nil nil]) #[257 “\211\205\f\301\300”\206\f\302\207" [magit-popup-variable-button magit-popup-format-variable-button ("")] 4 “\n\n(fn EV)”]([cl-struct-magit-popup-event 114 “branch.%s.rebase” magit-pull-format-branchrebase magit-cycle-branchrebase nil nil]) mapcar(#[257 “\211\205\f\301\300”\206\f\302\207" [magit-popup-variable-button magit-popup-format-variable-button ("")] 4 “\n\n(fn EV)”] ([cl-struct-magit-popup-event 114 “branch.%s.rebase” magit-pull-format-branchrebase magit-cycle-branchrebase nil nil] [cl-struct-magit-popup-event 67 “variables…” nil magit-branch-config-popup nil nil])) magit-popup-insert-section(magit-popup-variable-button ([cl-struct-magit-popup-event 114 “branch.%s.rebase” magit-pull-format-branchrebase magit-cycle-branch*rebase nil nil] [cl-struct-magit-popup-event 67 “variables…” nil magit-branch-config-popup nil nil]) “Configure”) magit-popup-insert-section(magit-popup-variable-button) magit-refresh-popup-buffer() magit-popup-mode-setup(magit-pull-popup nil) magit-invoke-popup(magit-pull-popup nil nil) magit-pull-popup(nil) funcall-interactively(magit-pull-popup nil) call-interactively(magit-pull-popup nil nil) command-execute(magit-pull-popup)

今天开着开着又遇到了。。。 这个具体是什么限制呀?子进程个数太多还是怎么样?

应该是 Windows 平台吧,Too many open files 只出现在 Windows 代码中:

~/src/emacs (master)$ git grep 'Too many open files'
src/w32.c:  {WSAEMFILE               , "Too many open files"},

原因可能比较复杂(Windows + Git + Emacs + Magit),(magit) Performance 中冶提到了一点 Windows 下的性能问题。另外可以考虑问下 Magit 那边。

mac呀…

OK,那我上面的猜测就是错的。

:joy:算了。。。也不怎么影响使用,不追究了2333

多谢帮助呀~~