Question: Flymake is being activated and I don't seem to find anything that triggers it in my configuration. Is there any way to get kind of a backtrace of what triggered such activation or in which hook it has been added?

Explanation of what is happening to me:

I'm currently using Emacs to edit Rust code. I have lsp activated, cargo package, racer and rust-mode. I have also installed and use flycheck-rust and I think that's all I have related with Rust in my config:

;; Rust
(use-package lsp-mode
  :ensure t
  (add-hook 'prog-major-mode #'lsp-prog-major-mode-enable)
  (setq lsp-rust-rls-command '("rustup" "run" "nightly" "rls")))

(use-package lsp-ui
  :ensure t
  (add-hook 'lsp-mode-hook 'lsp-ui-mode))

(use-package rust-mode
  (setq rust-format-on-save t)
  (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
  (setq company-tooltip-align-annotations t)
  (add-hook 'rust-mode-hook #'flycheck-mode)
  (add-hook 'rust-mode-hook 'hs-minor-mode)
  (add-hook 'rust-mode-hook 'lsp))

(use-package flycheck-rust)
(with-eval-after-load 'rust-mode
  (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))

(use-package racer
  :diminish racer-mode " ® "
  (add-hook 'rust-mode-hook #'racer-mode)
  (add-hook 'racer-mode-hook #'eldoc-mode)
  (add-hook 'racer-mode-hook #'company-mode))

(use-package cargo
  :diminish cargo-mode " CRG "
  (add-hook 'rust-mode-hook 'cargo-minor-mode))

The problem is that whenever I open a .rs file, Flymake gets activated (as well as flycheck but flycheck is wanted). I get all this minor modes activated:

Enabled minor modes: Async-Bytecomp-Package Auto-Composition
Auto-Compression Auto-Encryption Auto-Revert Blink-Cursor Cargo
Column-Number Company Delete-Selection Diff-Auto-Refine Display-Time
Eldoc Electric-Indent File-Name-Shadow Flycheck Flymake Font-Lock
Global-Company Global-Eldoc Global-Flycheck Global-Font-Lock
Global-Git-Commit Global-Linum Global-Magit-File
Global-Prettify-Symbols Hs Line-Number Linum Lsp Lsp--Managed Lsp-Ui
Lsp-Ui-Doc Lsp-Ui-Sideline Magit-Auto-Revert Magit-File Menu-Bar
Mouse-Wheel Override-Global Projectile Racer Rainbow-Delimiters
Recentf Shell-Dirtrack Show-Paren Tooltip Transient-Mark
  • What happens when your init file contains only your Rust config? – nega Apr 26 '19 at 13:00
  • 2
    Flymake is triggered by the first code lines in file lsp-mode.el, package lsp-mode. See this: github.com/emacs-lsp/lsp-mode - lsp-prefer-flymake how can be set/modified. – Ian Apr 26 '19 at 14:50
  • @Ian actually that was exactly the reason why flymake was being triggered. Thanks – Javier Sagredo Apr 29 '19 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.