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: Sat, 28 May 2016 10:53:38 +0300 Message-ID: <838tyuzkhp.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> <83inxzz5ha.fsf@gnu.org> <86a8jbxqjd.fsf@gmail.com> <83fut3z4bq.fsf@gnu.org> <861t4nxp61.fsf@gmail.com> <83d1o7z3gm.fsf@gnu.org> <86shx3w8wi.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1464422068 31594 80.91.229.3 (28 May 2016 07:54:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 May 2016 07:54:28 +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 Sat May 28 09:54:17 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 1b6Z4a-0001He-JQ for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 May 2016 09:54:16 +0200 Original-Received: from localhost ([::1]:52587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Z4W-0001BS-Ft for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 May 2016 03:54:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Z4Q-0001AK-RB for bug-gnu-emacs@gnu.org; Sat, 28 May 2016 03:54:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Z4M-0006ll-Nf for bug-gnu-emacs@gnu.org; Sat, 28 May 2016 03:54:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Z4M-0006lb-KI for bug-gnu-emacs@gnu.org; Sat, 28 May 2016 03:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b6Z4M-0007ew-Bx for bug-gnu-emacs@gnu.org; Sat, 28 May 2016 03:54: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: Sat, 28 May 2016 07:54: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.146442202929412 (code B ref 23609); Sat, 28 May 2016 07:54:02 +0000 Original-Received: (at 23609) by debbugs.gnu.org; 28 May 2016 07:53:49 +0000 Original-Received: from localhost ([127.0.0.1]:43153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6Z48-0007eK-NG for submit@debbugs.gnu.org; Sat, 28 May 2016 03:53:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6Z46-0007e1-TS for 23609@debbugs.gnu.org; Sat, 28 May 2016 03:53:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Z3y-0006e7-Fz for 23609@debbugs.gnu.org; Sat, 28 May 2016 03:53:41 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Z3p-0006ci-7L; Sat, 28 May 2016 03:53:29 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4000 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b6Z3n-0006n3-Bg; Sat, 28 May 2016 03:53:27 -0400 In-reply-to: <86shx3w8wi.fsf@gmail.com> (message from Jules Tamagnan on Fri, 27 May 2016 16:19:57 -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:118794 Archived-At: > From: Jules Tamagnan > Cc: 23609@debbugs.gnu.org, dgutov@yandex.ru > Date: Fri, 27 May 2016 16:19:57 -0400 > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > index 5aeefe4..46c3bd9 100644 > --- a/lisp/progmodes/python.el > +++ b/lisp/progmodes/python.el > @@ -4293,12 +4293,29 @@ 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") > + > +(defcustom python-eldoc-function-timeout 1 > + "Timeout for python-eldoc-function in seconds." > + :group 'python > + :type 'integer) > + > (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)) > +inferior Python process is updated properly. > + > +If `python-eldoc-function-timeout' seconds elapse before this > +function returns then `python-eldoc--get-doc' will be set to nil > +and eldoc will no longer return the documentation at the point > +automatically." > + (when python-eldoc--get-doc > + (with-timeout (python-eldoc-function-timeout > + (message "Eldoc mode echo-area display turned off in current buffer; eval (setq python-eldoc--get-doc t) to turn on") > + (setq python-eldoc--get-doc nil)) > + (python-eldoc--get-doc-at-point)))) > > (defun python-eldoc-at-point (symbol) > "Get help on SYMBOL using `help'. > > Here was my rendition of the task at hand. Thanks. We should try making the message text shorter, so it fits on a single line. > We could also perhaps make it such that if the timeout variable were > negative then instead of permanently stopping eldoc it would only > return, like you had suggested. A boolean defcustom could also be > used for that if we want. I don't see any significant advantage either way. > Also 'python-eldoc--get-doc' could be renamed to not be private if we > expect somebody to want to change it Yes, that variable should not be private if users are expected to set it. Alternatively, we could add a simple command to set the variable non-nil, which might also help making the message text shorter.