GNU bug report logs -
#23609
25.0.92; Python eldoc freeze
Previous Next
Reported by: Jules Tamagnan <jtamagnan <at> gmail.com>
Date: Tue, 24 May 2016 15:36:01 UTC
Severity: normal
Found in version 25.0.92
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #75 received at 23609 <at> debbugs.gnu.org (full text, mbox):
> From: Jules Tamagnan <jtamagnan <at> gmail.com>
> Cc: 23609 <at> debbugs.gnu.org, dgutov <at> yandex.ru
> Date: Fri, 27 May 2016 12:12:26 -0400
>
> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index 5aeefe4..8f01ac9 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -4293,12 +4293,18 @@ python-eldoc--get-doc-at-point
> (unless (zerop (length docstring))
> docstring)))))
>
> +(defvar-local python-eldoc-get-doc t
> + "If eldoc should be used to get the documentation automatically")
> +
> (defun python-eldoc-function ()
> "`eldoc-documentation-function' for Python.
> For this to work as best as possible you should call
> `python-shell-send-buffer' from time to time so context in
> inferior Python process is updated properly."
> - (python-eldoc--get-doc-at-point))
> + (when python-eldoc-get-doc
> + (with-timeout (1
> + (setq python-eldoc-get-doc nil))
> + (python-eldoc--get-doc-at-point))))
>
> (defun python-eldoc-at-point (symbol)
> "Get help on SYMBOL using `help'.
>
> This patch adds the buffer local variable 'python-eldoc-get-doc which is
> intially set to t but if eldoc takes longer than one second to fetch the
> documentation then it will be set to nil. With the variable being nil,
> eldoc will no longer try to automatically fetch the documentation. The
> documentation can still be fetched with "C-cC-f". This avoids removing
> global-eldoc mode and allows the user to manually fetch the
> documentation while disabling the automatic fetching which causes the
> unexpected freezing. If the user calls eldoc themselves then it can
> still freeze but then thats their fault and they can press "C-g" to send
> a keyboard interupt to their process. At least it won't freeze
> spontaneously.
Thanks, this is now clear. A coupe of comments:
. Should 1 be a defcustom? IOW, could it be that different users
have different annoyance thresholds, and are willing to wait
longer before turning eldoc-mode off?
. The problem happens only when the interpreter is busy doing
something, is that right? If so, perhaps we shouldn't turn
eldoc-mode off, but instead simply return?
. If we do turn eldoc-mode off, then I think a message to that
effect is in order, to let the user know.
Thanks for working on this.
This bug report was last modified 8 years and 351 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.