0

当在不太宽的缓冲区中进行编码时,应在行模式下可见的 flycheck 错误计数被截断。我如何保证 flycheck 模式计数在线路模式中按主要/次要模式的顺序排在第一位?

4

1 回答 1

2

次要模式按 的顺序显示minor-mode-alist。默认情况下,这仅反映了加载顺序(因此您提到了这种解决方法,但请注意,一旦加载了其他次要模式,该解决方法就会失败)。

在加载库后操作列表可让您持续保持所需的显示顺序。

(defun my-promote-flycheck (&optional _file)
  "Give `flycheck-mode' priority position in `minor-mode-alist'.

Called via `after-load-functions', as well as `after-init-hook'."
  (unless (eq (caar minor-mode-alist) 'flycheck-mode)
    (let ((found (assq 'flycheck-mode minor-mode-alist)))
      (when found
        (assq-delete-all 'flycheck-mode minor-mode-alist)
        (push found minor-mode-alist)))))

(add-hook 'after-load-functions 'my-promote-flycheck)
(add-hook 'after-init-hook 'my-promote-flycheck)
于 2017-06-08T10:20:50.593 回答