unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Kim <emacs18@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: info-look for things other than elisp lookup
Date: Sat, 15 Jan 2022 21:54:15 -0800	[thread overview]
Message-ID: <87sftoql88.fsf@gmail.com> (raw)
In-Reply-To: p91lezhxei7.fsf@retriever.mtv.corp.google.com

"T.V Raman" <raman@google.com> 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.




  reply	other threads:[~2022-01-16  5:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-15 14:25 info-look for things other than elisp lookup T.V Raman
2022-01-16  5:54 ` Richard Kim [this message]
2022-01-16 18:05   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sftoql88.fsf@gmail.com \
    --to=emacs18@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).