From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jules Tamagnan Newsgroups: gmane.emacs.bugs Subject: bug#23609: 25.0.92; Python eldoc freeze Date: Tue, 31 May 2016 13:35:27 -0400 Message-ID: <86shwyqgf4.fsf@gmail.com> 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> <838tyuzkhp.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1464716188 2796 80.91.229.3 (31 May 2016 17:36:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 May 2016 17:36:28 +0000 (UTC) Cc: 23609@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 31 19:36: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 1b7naS-0007mZ-W6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2016 19:36:17 +0200 Original-Received: from localhost ([::1]:37548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7naS-0006Ts-8F for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2016 13:36:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7naL-0006Ta-Ki for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 13:36:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7naE-0002ik-FJ for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 13:36:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7naE-0002ig-Bp for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 13:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b7naE-0007v4-4s for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 13:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jules Tamagnan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 May 2016 17:36: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.146471613830413 (code B ref 23609); Tue, 31 May 2016 17:36:02 +0000 Original-Received: (at 23609) by debbugs.gnu.org; 31 May 2016 17:35:38 +0000 Original-Received: from localhost ([127.0.0.1]:48578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7nZp-0007uS-Op for submit@debbugs.gnu.org; Tue, 31 May 2016 13:35:37 -0400 Original-Received: from mail-qk0-f181.google.com ([209.85.220.181]:36839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7nZn-0007uF-5P for 23609@debbugs.gnu.org; Tue, 31 May 2016 13:35:37 -0400 Original-Received: by mail-qk0-f181.google.com with SMTP id i187so8969171qkd.3 for <23609@debbugs.gnu.org>; Tue, 31 May 2016 10:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=M4JQZ2KERhtX7GdoJIGGecgkHHyoVMx3YrnZgjz0Exw=; b=FflJPd3Ohq5KLtfJTeOPzgqpSvuVT7s9f6R8RxvluMPVnnhd5bf08E2pbdsOoh421O zradNNDm/E0hRlerjXRjljDtNB+NNCQMmhp23GWaNmtuxXf+dE5eB7aO+C00YYtj31zC bvCh71Cb5l7Gsgg/etZ+IFzJiMRFa+AS7BMQxjE7mWjTS4znCTlAm/QnGZiuBfi2EHvP jzYDZgLv57eo6V1wpP6CACkcQ5gD2fpo0pRnwW+pKk3pQKZOM2Vah7+CqJ1CjS5AxSA/ m+5h8M8lgWx0stjZ+CTBR539Fhv1XrFh0b0lNQHib4gUjLMXTZktIp0vj15ubqjCy2Ce kDEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=M4JQZ2KERhtX7GdoJIGGecgkHHyoVMx3YrnZgjz0Exw=; b=I7gZ0KBvr9c4nwai2CAfTshRktvj2bIdL8SSm+u9ZkncrR7FfPmpogBS4lSmtiKwDz st4X7R6HJSU7+SblqJa7298yapeqZ6SyIRDQ89TLEjRnqXOtPMyBP2GyKc+zFw667Q5f PeD4jpLcuwAjsZfgWdDH/oFFbOrr+2hNO+6H1K47w8gYKHV55QachyZrfI8qDiH3Ze8F QqDFQCyhCEcfX05rb7uPORid5pRZASQDZ25qs3+amHiJ7H6Pf0CcjlglygKJO9FRr8g2 L1wr7WSysIJ/+ERq+XsiT5eCr8utA+Tsu6ji68H1VYhAKLAQDPJytRoV1io8UwZMfc2W YGJg== X-Gm-Message-State: ALyK8tJ9wYyFH77Cmt2IjQ5JlWeyonARyiDz3JOpeRekYjRx8VSr9dFUeO2Qdc6P3+SgtQ== X-Received: by 10.55.26.219 with SMTP id l88mr29580286qkh.14.1464716129412; Tue, 31 May 2016 10:35:29 -0700 (PDT) Original-Received: from bandersnatch ([130.132.236.142]) by smtp.gmail.com with ESMTPSA id 127sm11174361qhg.49.2016.05.31.10.35.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 May 2016 10:35:28 -0700 (PDT) In-Reply-To: <838tyuzkhp.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 May 2016 10:53:38 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) 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:118893 Archived-At: Eli Zaretskii writes: > 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. I've improved the documentation, added the boolean to make the timeout permanent and shortened the messages index 5aeefe4..d555e21 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4293,12 +4293,45 @@ python-eldoc--get-doc-at-point (unless (zerop (length docstring)) docstring))))) +(defvar-local python-eldoc-get-doc t + "Non-nil means eldoc should fetch the documentation + automatically. Set to nil by `python-eldoc-function' if + `python-eldoc-function-timeout-permanent' is non-nil and + `python-eldoc-function' times out.") + +(defcustom python-eldoc-function-timeout 1 + "Timeout for `python-eldoc-function' in seconds." + :group 'python + :type 'integer) + +(defcustom python-eldoc-function-timeout-permanent t + "Non-nil means that when `python-eldoc-function' times out +`python-eldoc-get-doc' will be set to nil" + :group 'python + :type 'boolean) + (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 if +`python-eldoc-function-timeout-permanent' is non-nil +`python-eldoc-get-doc' will be set to nil and eldoc will no +longer return the documentation at the point automatically. + +Set `python-eldoc-get-doc' to t to reenable eldoc documentation +fetching" + (when python-eldoc-get-doc + (with-timeout (python-eldoc-function-timeout + (if python-eldoc-function-timeout-permanent + (progn + (message "Eldoc echo-area display muted in current buffer, see `python-eldoc-function'") + (setq python-eldoc-get-doc nil)) + (message "`python-eldoc-function' timed out, see `python-eldoc-function-timeout'"))) + (python-eldoc--get-doc-at-point)))) (defun python-eldoc-at-point (symbol) "Get help on SYMBOL using `help'.