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: Fri, 27 May 2016 12:12:26 -0400 Message-ID: <86lh2vo4yd.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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1464365695 6502 80.91.229.3 (27 May 2016 16:14:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 May 2016 16:14:55 +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 Fri May 27 18:14:43 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 1b6KPL-0002oe-95 for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 May 2016 18:14:43 +0200 Original-Received: from localhost ([::1]:46853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6KPJ-00067l-TB for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 May 2016 12:14:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6KNo-0004V2-IR for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 12:13:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6KNi-00057q-D4 for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 12:13:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6KNi-00057c-8m for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 12:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b6KNh-0005Ul-Va for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 12:13: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: Fri, 27 May 2016 16:13:01 +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.146436555521087 (code B ref 23609); Fri, 27 May 2016 16:13:01 +0000 Original-Received: (at 23609) by debbugs.gnu.org; 27 May 2016 16:12:35 +0000 Original-Received: from localhost ([127.0.0.1]:42781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6KNH-0005U3-45 for submit@debbugs.gnu.org; Fri, 27 May 2016 12:12:35 -0400 Original-Received: from mail-qg0-f44.google.com ([209.85.192.44]:34442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6KNF-0005Tq-Ag for 23609@debbugs.gnu.org; Fri, 27 May 2016 12:12:33 -0400 Original-Received: by mail-qg0-f44.google.com with SMTP id 90so52872360qgz.1 for <23609@debbugs.gnu.org>; Fri, 27 May 2016 09:12:33 -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=7OmeALhrMkntzvjn/mt7FJSmHgzO4U4qsU/6QBTr7BA=; b=yql6I/Ln4Sz4sbC6Zgtpg4ZqlxJQt9j5Hdb253sO/5VlBzd0PQvuZJhheWPehS+y/D hov9IHuP0NAykycRK0Ao0CSchu5V5h2av8j5pj/5hKgl1fojD6SyPnBns8x9CNopT9Sz y8ibW+R3veeFQZMuYSxH3bNDBrlwudSRKLOXrGjCMaAr+PZ2IHdyXv6+Qanz1lBbm7HP sB6ItgimvBIz31eeMN4peNl+UUIoV6qezN7hoiwfjs2PNo/RXXsjvl0G1x0KRt8xKzkk JUwcyLaGIbCa7GC6kwZ+oI1COx78gLRh9KqH2/CFQ7LJp7RYWNa8qI+nBV5RyLXD3/xZ tXaw== 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=7OmeALhrMkntzvjn/mt7FJSmHgzO4U4qsU/6QBTr7BA=; b=f1fZUpGDw95mQ8LY+C3+vxIq2wcPDvt6wQrMm6rzeVh+jQgV4T1TiuDBwcMGQCuZVr Ja72NQEjjvwcWPJ8RpLGuK14B3Qu/UKFXmYwjsgMdnri77QnPvBS3bh12cqA1GV6zByH XNl3Mxhy0WVAlny804l8zYI/x1YX5o7EquJ7C4cKelj7wSVvH9NjJQowk5sXC05DLs7X HugFfZ8/gRei/0imaDmfVpbAgVLSZlGc605GCkCYaZ6UdTUalGyGBjHY8Es2/SXBPX+H rFzwYztz8DRIzuafc/ZVWsRGoppzXB4I3v6EDt72VDQxaI0Ep2Ks9GE+vaifCb6rPZ5o 1Rog== X-Gm-Message-State: ALyK8tJJ/QrCP6OryYjWTb8m064FCCD/i9ZI71+9DKwuMM1aOhvSc6hkiuoUQPIErr3BAA== X-Received: by 10.140.95.68 with SMTP id h62mr14059656qge.33.1464365547679; Fri, 27 May 2016 09:12:27 -0700 (PDT) Original-Received: from bandersnatch ([130.132.236.142]) by smtp.gmail.com with ESMTPSA id s3sm4221669qtd.19.2016.05.27.09.12.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 May 2016 09:12:26 -0700 (PDT) In-Reply-To: <83d1o726si.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 27 May 2016 12:23:41 +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:118765 Archived-At: Eli Zaretskii writes: >> From: Jules Tamagnan >> Cc: Dmitry Gutov , 23609@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.