【问题标题】:Display Flycheck buffer (with errors) when saving保存时显示 Flycheck 缓冲区(有错误)
【发布时间】:2018-01-14 02:52:24
【问题描述】:

在 Emacs 中,只有在出现错误时才自动显示 Flycheck 缓冲区的方式是什么?

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

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

【问题讨论】:

    标签: emacs lint flycheck linter


    【解决方案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)
    

    【讨论】:

    • 问题说明“仅在有错误的情况下”。您的解决方案一直显示错误列表
    猜你喜欢
    • 1970-01-01
    • 2023-04-04
    • 2021-06-11
    • 1970-01-01
    • 1970-01-01
    • 2019-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多