From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23609: 25.0.92; Python eldoc freeze Date: Fri, 27 May 2016 22:05:37 +0300 Message-ID: <83inxzz5ha.fsf@gnu.org> References: <867fejo4g2.fsf@gmail.com> <57454201.10607@easy-emacs.de> <86bn3umahs.fsf@gmail.com> <5745C5D9.50701@easy-emacs.de> <861t4orf3h.fsf@gmail.com> <834m9k3hmz.fsf@gnu.org> <83wpmg229w.fsf@gnu.org> <86mvncpwso.fsf@gmail.com> <83d1o726si.fsf@gnu.org> <86lh2vo4yd.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1464375989 8252 80.91.229.3 (27 May 2016 19:06:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 May 2016 19:06:29 +0000 (UTC) Cc: 23609@debbugs.gnu.org, dgutov@yandex.ru To: Jules Tamagnan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 27 21:06:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b6N5M-0006w4-Ia for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 May 2016 21:06:16 +0200 Original-Received: from localhost ([::1]:47454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6N5I-0000Bi-0S for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 May 2016 15:06:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6N5C-0000Ab-6S for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 15:06:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6N58-0001Jr-ST for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 15:06:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6N58-0001Jb-Or for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 15:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b6N58-0002qs-Ge for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 15:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 May 2016 19:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23609 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23609-submit@debbugs.gnu.org id=B23609.146437595410948 (code B ref 23609); Fri, 27 May 2016 19:06:02 +0000 Original-Received: (at 23609) by debbugs.gnu.org; 27 May 2016 19:05:54 +0000 Original-Received: from localhost ([127.0.0.1]:42859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6N4z-0002qW-OH for submit@debbugs.gnu.org; Fri, 27 May 2016 15:05:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6N4x-0002qI-MF for 23609@debbugs.gnu.org; Fri, 27 May 2016 15:05:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6N4p-00019d-2h for 23609@debbugs.gnu.org; Fri, 27 May 2016 15:05:46 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6N4d-00017D-Ej; Fri, 27 May 2016 15:05:31 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3615 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b6N4Z-0005CF-TA; Fri, 27 May 2016 15:05:28 -0400 In-reply-to: <86lh2vo4yd.fsf@gmail.com> (message from Jules Tamagnan on Fri, 27 May 2016 12:12:26 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118777 Archived-At: > From: Jules Tamagnan > Cc: 23609@debbugs.gnu.org, dgutov@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.