2

在 Emacs 中,只有在出现错误的情况下才会在保存时自动显示 Flycheck 缓冲区?

有点像https://github.com/steelbrain/linter

我在https://stackoverflow.com/questions/tagged/flycheck?sort=votes&pageSize=50上进行了搜索,但没有找到任何接近的东西。

4

1 回答 1

1

将以下内容添加到~/.emacs,这会将其绑定到C-x C-s

(defun save-buffer-maybe-show-errors ()
  "Save buffer and show errors if any."
  (interactive)
  (save-buffer)
  (when (not flycheck-current-errors)
    (flycheck-list-errors)))
;; Bind it to some key:
(global-set-key (kbd "C-x C-s") 'save-buffer-maybe-show-errors)
于 2017-08-10T18:51:02.170 回答