From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Kim Newsgroups: gmane.emacs.devel Subject: Re: info-look for things other than elisp lookup Date: Sat, 15 Jan 2022 21:54:15 -0800 Message-ID: <87sftoql88.fsf@gmail.com> References: Reply-To: emacs18@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3619"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.90 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:9x/OQbow+dVHQgSfYhAmQBC3cE0= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 16 17:51:55 2022 Return-path: Envelope-to: ged-emacs-devel@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 1n98l1-0000g2-2q for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Jan 2022 17:51:55 +0100 Original-Received: from localhost ([::1]:48954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n98kz-0000Fq-NP for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Jan 2022 11:51:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n98jN-000806-S3 for emacs-devel@gnu.org; Sun, 16 Jan 2022 11:50:13 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:43178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n98jF-0004FC-KH for emacs-devel@gnu.org; Sun, 16 Jan 2022 11:50:06 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1n98jC-0008fn-2x for emacs-devel@gnu.org; Sun, 16 Jan 2022 17:50:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 23 X-Spam_score: 2.3 X-Spam_bar: ++ X-Spam_report: (2.3 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284835 Archived-At: "T.V Raman" writes: > info-look works for elisp symbols, but apparently for nothing else, > though the docs indicate it should be able to lookup things in all of > the installed files. > > Is the above expectation true? > > As an example, try C-h S in a python buffer -- it can find none of the > Python symbols in the installed python info pages. > The Messages buffer shows: > > Not documented as a symbol: round > Not documented as a symbol: list > > Interestingly, when you look up an elisp symbol, you see it searching > through emacs and cl info pages according to the Messages log. I used org-mode markup below. Please let me know if this is not appropriate for this list. When ~C-h S~ key, bound to ~info-lookup-symbol~, is hit with the cursor over "round" symbol, then it is reasonable to expect this to bring up Python info document and put the cursor on the line that documents ~round()~ python function. However we encounter this error: : Not documented as a symbol: round I believe this is due to the absence of "round" item in the menu at ~(python)Index~ info node. Instead of item named "round" I see menu time named "round() (built-in function)". I have ~python.info~ file installed via https://github.com/Wilfred/python-info.git package. The problem seems to be the following code near the top of ~info-lookup~ function: : (assoc (if ignore-case (downcase item) item) completions) where we try to find item named "round" when the ~completions~ alist only has item named "round() (built-in function)". I think python.info is generated from python.texi which in turn is generated from python rst documents via sphinx. Could it be that sphinx or sphinx configuration was modified to generate more verbose index entries and so broke info-lookup? Regardless should info-lookup be modified so that when there is no exact match of menu items, then it should relax the criteria and see if there are other menu items? For example if "round" does not match, then look for menu items that match ~^round\b~ regexp. If I manually select "round() (built-in function)" menu item in (python)Index node, then emacs brings up "Built-in Functions" node and places the cursor at the first line of the following: #+begin_example -- Function: round (number[, ndigits]) Return the floating point value `number' rounded to `ndigits' digits after the decimal point. If `ndigits' is omitted, it defaults to zero. The result is a floating point number. Values are rounded to the closest multiple of 10 to the power minus `ndigits'; if two multiples are equally close, rounding is done away from 0 (so, for example, ‘round(0.5)’ is ‘1.0’ and ‘round(-0.5)’ is ‘-1.0’). Note: The behavior of *note round(): 1c6. for floats can be surprising: for example, ‘round(2.675, 2)’ gives ‘2.67’ instead of the expected ‘2.68’. This is not a bug: it’s a result of the fact that most decimal fractions can’t be represented exactly as a float. See *note Floating Point Arithmetic; Issues and Limitations: 634. for more information. #+end_example Thus it seems like to me that modifying info-lookup to relax node name matching criteria could be very helpful in this case.