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 #51 received at 23609 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Jules Tamagnan <jtamagnan <at> gmail.com>
>> Cc: Dmitry Gutov <dgutov <at> yandex.ru>, 23609 <at> debbugs.gnu.org
>> Date: Thu, 26 May 2016 13:13:27 -0400
>>
>> I've already filled out the proper paperwork and wouldn't mind doing
>> it. Would a timeout, of one second seem acceptable? If getting the
>> documentation takes longer than 1 second then it should timeout and we
>> should then locally set global-eldoc and eldoc mode to -1.
>
> Sorry, I'm not sure I'm following: what timeout are you talking about?
> (I've re-read the bug discussion, and there's no reference to any
> timeouts there, either.)
>
> Perhaps show a patch you had in mind, then your intent will be clear?
>
> Thanks.
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.
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.