jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 262 forks source link

Elpy removes "ElDoc" indicator from modeline #1788

Closed ngleb closed 4 years ago

ngleb commented 4 years ago

Summary

elpy modifies modeline. Setting variable (setq elpy-remove-modeline-lighter nil) does not help.

Steps to reproduce

So basically I have two ways of reproducing the issue: 1) Config like below. Emacs started, I can see ElDoc indicator. If I open any *.py file, then ElDoc disappears. 2) Removing this line :mode ("\\.py\\'" . python-mode) so that elpy is loaded at startup. Then ElDoc indicator disappears from the very beginning. Setting variable (setq elpy-remove-modeline-lighter nil) does not help.

This happens for ALL buffers, not just python-mode buffers.

Elpy configuration in my init.el

(use-package python
  :mode ("\\.py\\'" . python-mode)
  :config
  (setq python-shell-interpreter "python"
        python-shell-interpreter-args "-i")
  (setq python-indent-guess-indent-offset nil))

(use-package elpy
  :after python
  :init
  (setq elpy-remove-modeline-lighter nil)
  :config
  (setq elpy-rpc-virtualenv-path 'current)
  (setq elpy-shell-echo-input nil)
  (delete 'elpy-module-highlight-indentation elpy-modules)
  (delete 'elpy-module-flymake elpy-modules)
  (add-hook 'elpy-mode-hook 'flycheck-mode)
  (elpy-enable))

Is it possible to completely disable any modifications to modeline except for adding "elpy'?

ngleb commented 4 years ago

While this code checks this variable: https://github.com/jorgenschaefer/elpy/blob/7e8181dbd6b900e6434218d2d5ccbac4c7615c41/elpy.el#L2748-L2756

It is not checked here: https://github.com/jorgenschaefer/elpy/blob/7e8181dbd6b900e6434218d2d5ccbac4c7615c41/elpy.el#L3098

galaunay commented 4 years ago

Absolutely right, I have merged the PR.