From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#45348: 27.1; python-eldoc-setup-code uses obsolete python function Date: Mon, 28 Dec 2020 23:58:53 +0000 Message-ID: <87pn2tiite.fsf@gmail.com> References: <197a8432-07fd-4639-e504-0fde30d3f088@gmail.com> <877dp8dqpp.fsf@posteo.net> <87zh1x6gyt.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7960"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Steven De Herdt , 45348@debbugs.gnu.org, monnier@iro.umontreal.ca To: Tomas Nordin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 29 01:00:35 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ku2RH-0001yv-57 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Dec 2020 01:00:35 +0100 Original-Received: from localhost ([::1]:39144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ku2RF-0004Jq-Fs for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 19:00:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ku2Qk-0004Ib-Nq for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 19:00:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ku2Qk-0004O3-FS for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 19:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ku2Qk-0002KK-Er for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 19:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Dec 2020 00:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45348 X-GNU-PR-Package: emacs Original-Received: via spool by 45348-submit@debbugs.gnu.org id=B45348.16091999468846 (code B ref 45348); Tue, 29 Dec 2020 00:00:02 +0000 Original-Received: (at 45348) by debbugs.gnu.org; 28 Dec 2020 23:59:06 +0000 Original-Received: from localhost ([127.0.0.1]:37184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ku2Pq-0002Ib-Ep for submit@debbugs.gnu.org; Mon, 28 Dec 2020 18:59:06 -0500 Original-Received: from mail-wr1-f48.google.com ([209.85.221.48]:40108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ku2Pl-0002I1-Id for 45348@debbugs.gnu.org; Mon, 28 Dec 2020 18:59:05 -0500 Original-Received: by mail-wr1-f48.google.com with SMTP id 91so12748924wrj.7 for <45348@debbugs.gnu.org>; Mon, 28 Dec 2020 15:59:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=wIWE7++fuWnM03ZxEBEwq2IwJ3TVXwdAjLhAkFVg19M=; b=jN/ahT95l+2kkLeMLzex9ykmvHwxZlKuu+y42y+Oyw3zVHHG5zXWhJj+lWCucFFQ7H Fs+e7dImDm3E3KUGcYYUe5z28LZDaQe+Sel3NR7uNfhGZOF4hKrLAJgYXKpATkmammUr Fk8LHCkECIl9xDYCUxII8dwRXU9+vARxhyG3w937bwlbCJJkpXBGWNMzT1gglBCjSiGw xgrwg9Oc9G/E2sQCYygb7l1Mnl2+YmxKv9gYyoytiMMOOuQg0ZddDYKXiWCpNVefQ+0o WoGGcfX3gYapba2jdDolypocF02z2N0O9pj6TUS6NvbZ8t91KYDZR8rEWLc1tPMQT3+l wgKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=wIWE7++fuWnM03ZxEBEwq2IwJ3TVXwdAjLhAkFVg19M=; b=Js/V1mrZ5NGn5qY5ANPlsDwiCauJnHTJmOKneRoI+37k7sf4hKrPgFnSDKHks80HIM ptTHB1aBVkjrA9ZLsCtX+nHbTMfROf6lEQAD6zE7hiS1C/xpJYzyg3o3mRDcL30xjCgb Djje5lzZqhUeK9jed+Nn7u+Y/lz57zHsyg1RdR/XgDqxgob645m8zlPuj4I+wW7pUUJz J2LEj3HEPjqcfW6Rg/2gqorayRS8G3BKAjlUpo9D92dlDzp7VNaQrRDubt/ZbDQcTBlj B0n821pwpAAAJB2FFtjEDSlM2aC1gyuq1L2XdqL841SiMMXCBUFi15VsO5uX87zvEnqQ M9Vw== X-Gm-Message-State: AOAM531xNETQmKFcIYivB9YFpXeE7Icr8mPaIWpPw/t/p6bODL14DL4I whpkHCNy3Hvtws27Z9Tm0j0= X-Google-Smtp-Source: ABdhPJzebCoaWRPcJCyFLQMfxWh+yEs8p0x+9XUlrTI1nDJL5NuHkX5j0/HmywnGkA9UKNtjlCyU9w== X-Received: by 2002:a5d:61c4:: with SMTP id q4mr53336705wrv.304.1609199935621; Mon, 28 Dec 2020 15:58:55 -0800 (PST) Original-Received: from krug ([89.180.149.164]) by smtp.gmail.com with ESMTPSA id h83sm1149838wmf.9.2020.12.28.15.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 15:58:54 -0800 (PST) In-Reply-To: <87zh1x6gyt.fsf@posteo.net> (Tomas Nordin's message of "Mon, 28 Dec 2020 17:19:38 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196902 Archived-At: Tomas Nordin writes: >> All of those things have been touched recently by me, and I'd appreciate >> the feedback. > > OK, thanks. Then we know the API to read up on when it comes to that. > > I would be happy to try and help improving the doc support in python.el. > The strategy I would suggest to do that would be > > -- C-c C-d python-describe-at-point > > Make this display full documentation akin to C-h f in elisp. Document > -- Automatic help display of objects > > Make this show signatures always. (akin to elisp mode). > > But I don't know if anybody care to see this happen. I would. Or at least I think these ideas are welcome input for solving the broader problem of inconsistency of documentation systems in Emacs. In fact, I'm going to take this opportunity to lay out a plan that I've been thinking of, to collect some early feedback, and to seize on any motivation that you or someone else may have to work on this. I quite agree with you when you say there is something that should display full documentation akin to C-h f in Elisp. But this is not only for Python, it is for all languages -- including Elisp. In my opinion, that something should be 'M-x eldoc' (and we can chose a prominent shortcut for it later). In the latest Emacs, when invoked interactively, it pops up a new buffer (like C-h f does) which contains detailed information about how to use a particular element of the language (a function, a procedure, a variable, etc). When invoked automatically by a background process, it behaves more discreetly, but and normally displays a shorter string in the echo area. Under the hood, the ElDoc framework also now possesses the main tools to help segregate succint short summaries that can be shown in a constrained setting -- such as the echo area -- from longer descriptions that are more suitable for larger outlets, such as buffers, separate frame and long-winded popup widgets. These tools are the aforementioned eldoc-documentation-functions and eldoc-display-functions. In my view we're only missing a protocol for the former to communicate to the latter how small or large the produces pieces of documentation are. How? Here's the current situation in Elisp mode: M-x eldoc will call on one or two backends (sometimes both, depending on eldoc-documentation-strategy) to document the thing at point: the variable documentation one and the function documentation one. For historical reasons, they return simple one liners for displaying in the echo area. But each could _additionally_ return much richer descriptions like the ones that C-h v and C-h f do. They could return this in new a :FULL-DOC property: * eldoc-display-in-echo-area would ignore it, since it is content that doesn't fit its target: * eldoc-display-in-buffer function would utilize to format a buffer that would look much like the *Help* buffer does nowadays. Whether that new property should be a string, a function, a buffer, or any of the above is an implementation detail we'd have to think up. Regardless, I'm sure something like this could be thought up for some future Python backend(s) as well: an Eldoc backend that returns a short summary (the signature, presumably) and a longer description of the thing at point. Other pieces of the puzzle to consider here are the somewhat underused/defunct help-at-pt.el which happens to have a good shortcut in 'C-h .'. It could be merged with ElDoc and lend that shortcut to M-x eldoc. Jo=C3=A3o