gpt4 book ai didi

emacs - 如何限制 flyspell 给出的 "suggestions"的数量?

转载 作者:行者123 更新时间:2023-12-04 16:50:06 24 4
gpt4 key购买 nike

在 emacs flyspell 模式下,有时建议列表真的很长,以至于弹出菜单比屏幕高,需要垂直滚动菜单,因为“保存单词”选项在菜单底部.

有没有办法执行以下操作之一:

  1. 将“保存单词”移至菜单顶部?
  2. 对显示的建议数量设置硬性限制?
  3. 修改匹配词的阈值?

最佳答案

此代码会将所有 ispell 解决方案限制为最大 limit-ispell-choices-to,从而在 flyspell 中获得所需的限制。

(defvar limit-ispell-choices-to 5
"Number indicating the maximum number of choices to present")

(defadvice ispell-parse-output (after limit-ispell-choices activate)
(when (and (listp ad-return-value)
ad-return-value)
(let* ((miss-list-end (nthcdr (- limit-ispell-choices-to 1)
(nth 2 ad-return-value)))
(guess-list-end (nthcdr (- limit-ispell-choices-to 1)
(nth 3 ad-return-value))))
(when miss-list-end (setcdr miss-list-end nil))
(when guess-list-end (setcdr guess-list-end nil)))))

关于emacs - 如何限制 flyspell 给出的 "suggestions"的数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19186305/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com