63 lines
2.7 KiB
EmacsLisp
63 lines
2.7 KiB
EmacsLisp
;;; syntax-checking-settings --- Settings file for syntax checking features
|
|
|
|
;;; Commentary:
|
|
;; Syntax checking configurations
|
|
|
|
;; - flymake built-in
|
|
;; - flycheck
|
|
|
|
;; Requirements:
|
|
;; - flycheck https://melpa.org/#/flycheck https://github.com/flycheck/flycheck
|
|
|
|
;; `flycheck' is used, because flymake supports less languages than
|
|
;; flycheck
|
|
|
|
;; there are in place temporary files for Python, LaTeX and Emacs
|
|
;; Lisp, see https://github.com/flycheck/flycheck/issues/92 if working
|
|
;; with some kind of cloud sync systems, one may filter "flycheck_*"
|
|
;; files
|
|
|
|
;;; Code:
|
|
|
|
(use-package flycheck
|
|
;; do not load directly with e.g. (global-flycheck-mode) or via
|
|
;; after-init-hook while loading the init because flycheck will freeze
|
|
;; for a short while. Therefore better defer loading.
|
|
:defer t
|
|
:init
|
|
(require 'flycheck-autoloads)
|
|
(setq flycheck-mode-line-prefix "F") ;; \u24BB \u01D4D5 \u2708 f
|
|
(setq flycheck-mode-line '(:eval (concat (flycheck-mode-line-status-text) " ")))
|
|
:config
|
|
(setq-default flycheck-disabled-checkers '(python-flake8)) ;; disable the python-flake8 checker. This will make the next checker which is python-pylint to be used.
|
|
(setq flycheck-check-syntax-automatically '(save mode-enabled)) ;; flycheck only while saving, default is (save idle-change new-line mode-enabled)
|
|
(setq flycheck-emacs-lisp-load-path 'inherit) )
|
|
|
|
(use-package flycheck-posframe
|
|
;; https://melpa.org/#/flycheck-posframe
|
|
:after (flycheck)
|
|
:if (display-graphic-p)
|
|
:init (require 'flycheck-posframe-autoloads)
|
|
:config
|
|
(add-hook 'flycheck-mode-hook #'flycheck-posframe-mode)
|
|
(setq flycheck-posframe-position 'window-bottom-left-corner)
|
|
(setq flycheck-posframe-info-prefix "➤ ")
|
|
(setq flycheck-posframe-warning-prefix "➤ ") ;; "➤ " "\u26a0 "
|
|
(setq flycheck-posframe-error-prefix "➤ ")
|
|
(setq flycheck-posframe-border-use-error-face t)
|
|
(setq flycheck-posframe-border-width 1)
|
|
(set-face-attribute 'flycheck-posframe-info-face nil
|
|
:inherit nil
|
|
:foreground (plist-get (face-attribute 'flycheck-info :underline) :color))
|
|
(set-face-attribute 'flycheck-posframe-warning-face nil
|
|
:inherit nil
|
|
:foreground (plist-get (face-attribute 'flycheck-warning :underline) :color))
|
|
(set-face-attribute 'flycheck-posframe-error-face nil :inherit 'error
|
|
:inherit nil
|
|
:foreground (plist-get (face-attribute 'flycheck-error :underline) :color))
|
|
;; (set-face-attribute 'flycheck-posframe-border-face nil :inherit nil :foreground "#dc752f")
|
|
)
|
|
|
|
(provide 'syntax-checking-settings)
|
|
;;; syntax-checking-settings.el ends here
|