Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eldoc is enabled by default after installing / uninstalling Elpy #274

Closed
amelio-vazquez-reina opened this issue Jul 8, 2014 · 6 comments
Labels
Milestone

Comments

@amelio-vazquez-reina
Copy link

I just tried installing (and later uninstalling Elpy) from Emacs, but Eldoc-mode stays remains activated on every Python buffer by default. I don't like Eldoc always showing information on my minibuffer, so I tried disabling the activation by default by adding the (eldoc-mode 0) to my current python-mode hook with no luck:

(defun my-python-mode-hook () 
    (eldoc-mode 0)
  (linum-mode 1)) 
(add-hook 'python-mode-hook 'my-python-mode-hook) 

With this, my questions are:

  1. How does Elpy exactly activate Eldoc by default on every Python buffer?
  2. How can I disable its activation by default either with Elpy installed or after uninstalling it?

The original thread on SO can be found here.

@jorgenschaefer jorgenschaefer added this to the v1.5 milestone Jul 8, 2014
@jorgenschaefer
Copy link
Owner

elpy-enable adds elpy-mode to python-mode-hook, which then activates elpy-module-eldoc which then in turn runs eldoc-mode. If you have uninstalled Elpy and it's still doing things, make sure elpy-mode is not in python-mode-hook anymore (e.g. via elpy-disable or by restarting Emacs).

@amelio-vazquez-reina
Copy link
Author

Thanks @jorgenschaefer -- I have tried restarting Emacs a few times with no luck. I know for sure I haven't edited .emacs, so I am surprised that elpy (or eldoc or some other dependency) left a hook for python-mode elsewhere. The call to (eldoc-mode 0) I included above was precisely to try to disable it, since it is always enabled by default on my python buffers.

From what you said, the activation of eldoc would not be caused by a hook for python-mode, but by the activation of elpy-module-eldoc. What's strange that this activation still takes place after uninstalling elpy and restarting Emacs.

@amelio-vazquez-reina
Copy link
Author

On this note, here is the value of python-mode-hook:

Value: (jedi:setup
 (lambda nil
     (setq ffap-alist
                 (remove
                    '(python-mode . py-ffap-module-path)
                    ffap-alist))
     (setq ffap-alist
                 (remove
                    '(python-mode . py-module-path)
                    ffap-alist))
     (setq ffap-alist
                 (remove
                    '(inferior-python-mode . py-ffap-module-path)
                    ffap-alist)))
 #[nil "��\304\302!\210\305�\304\303!\210\306\211�\207"
             [py-indent-tabs-mode indent-tabs-mode beginning-of-defun-function end-of-defun-function make-local-variable py-beginning-of-def-or-class py-end-of-def-or-class]
             2]
 py-set-ffap-form my-python-mode-hook)

Original value was nil

The only function that I have manually defined myself above is my-python-mode-hook which is:

(defun my-python-mode-hook () 
    (eldoc-mode 0)
  (linum-mode 1)) 
(add-hook 'python-mode-hook 'my-python-mode-hook)  

@jorgenschaefer
Copy link
Owner

If you have uninstalled Elpy and restarted Emacs, it is highly unlikely that Elpy would enable eldoc-mode for you. You can try to start Emacs with the -Q option, see if the behavior continues, and if not, slowly enable things from your .emacs (possibly starting with M-x package-initialize) to see what causes the behavior to reappear.

@jorgenschaefer jorgenschaefer modified the milestones: v1.6, v1.5 Jul 26, 2014
@jorgenschaefer
Copy link
Owner

Any update on this? Is this still happening?

@amelio-vazquez-reina
Copy link
Author

Thanks. Enabling things slowly made helped me finding the problem, as you pointed out. I will re-open if it comes back, but I think I am all set!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants