Corfu在Emacs 31下好像自动用的tty-child-frame. 之前在Emacs30 用corfu-terminal没出过问题
补齐后
新人只能贴一张图。。。
Doom Emacs · GitHub ,人家就没说支持31版本,想解决只能自己测试了。
是啊,所以没法在doom的github上提个bug。 corfu的又需要emacs -q 重现。。
先试一下 minimal 的 emacs (emacs -q -nw --load xxx.el) 能不能复现 corfu 的这个 problem。
我使用corfu 的体验不太好,时不时在选择一个后选项后,corfu 连同候选项和它的类型一起插入,麻烦得很。反倒是用了这么多年company 没啥问题。
可能corfu 在理念上要先进一些,但是company 更好配置,更稳定
猜测是你没配置好corfu,导致和你习惯不一致
我没啥特别的习惯,最基本的配置,用来配合eglot 写代码. 报了问题Corfu inserts type of the candidate. · minad/corfu · Discussion #599 · GitHub
(use-package corfu
:custom
(corfu-cycle t)
(corfu-preview-current nil)
:init
(global-corfu-mode)
(corfu-history-mode)
(corfu-popupinfo-mode)
)
(use-package cape
:bind ("M-/" . cape-prefix-map) ;; Alternative key: M-<tab>, M-p, M-+
:init
(add-hook 'completion-at-point-functions #'cape-dabbrev)
(add-hook 'completion-at-point-functions #'cape-file)
(add-hook 'completion-at-point-functions #'cape-elisp-block)
(add-hook 'completion-at-point-functions #'cape-history)
)
(setq completion-category-overrides '((eglot (styles orderless))
(eglot-capf (styles orderless))))
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
你尝试下
(defun corfu--hide-frame-deferred (frame)
"Deferred hiding of child FRAME."
(when (and (frame-live-p frame) (frame-visible-p frame))
(set-frame-parameter frame 'corfu--hide-timer nil)
(with-current-buffer (window-buffer (frame-root-window frame))
(with-silent-modifications
(delete-region (point-min) (point-max))))
;; TTY child frame: delete instead of make-invisible (bug in Emacs 31 TTY)
(if (display-graphic-p)
(make-frame-invisible frame)
(delete-frame frame))))
make-frame-invisible可能有问题,改动之后就好了。我出现问题的场景是vertico启动不能执行corfu-quit。如果还有出现类似问题的朋友,可以尝试更改一下,试试能不能解决此问题。
试了下,确实是这个问题。
这个是不是得在Emacs邮件列表里报个bug?不知道Emacs -q里怎么重现
我给corfu写了issue。按理说应该是写给emacs的,但是我认为维护corfu的人写更合适些。写问题还得有个最小案例,我懒得弄了,调试了很多遍,最后揪出是这个问题。
看来对方并不想报告这个问题,毕竟这是个上游问题。我没有兴趣去做最小测试来报告这个问题。你可以试试。
不行,我再吐槽两句,其实这种问题就像个皮球,这个make-frame-invisible就是只能用在gui上也没话说,因为大可以踢皮球, 这个函数不能处理tty child frame。毕竟terminal上压根就没支持类似make frame 等功能的。
即使 emacs 上游做 tty child frame 这样的功能,下游做相应功能也少之又少,凑合着用吧。
这东西确实头疼。我只在doom-emacs上能复现这个问题。Emacs -q一直复现不了。 但doom 不处理非稳定版的bug,其他地方又都要求Emacs -q重现。 只能等Emacs 31发布后再看看了。
真好,终于有人在做tty child frame 相关工作的时候重现了我说的这个问题。等他这个特性做好,估计是既能解决之前的bug,也能享受新的特性。
Emacs31 中custom-face似乎不生效?有人遇到么
确认问题已经解决,我那个做法可以不用了。