Subject: Re: bug#42753: 26.3; `info-lookup.el': Add all manuals delivered by `emacs -Q', for `emacs-lisp-mode'

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Aug 2020 11:42:01 +0300

> Date: Fri, 7 Aug 2020 15:20:15 -0700 (PDT)
> From: Drew Adams <[email-masked]>
> 
> with this :doc-spec value:
> 
> '(;; Commands with key sequences appear in nodes as `foo' and
>   ;; those without as `M-x foo'.
>   ("(emacs)Command Index"                nil "['`']\\(M-x[ \t\n]+\\)?" "['']")
>   ;; Variables normally appear in nodes as just `foo'.
>   ("(emacs)Variable Index"               nil "['`']" "['']")
>   ;; Almost all functions, variables, etc appear in nodes as
>   ;; " -- Function: foo" etc.  A small number of aliases and
>   ;; symbols appear only as `foo', and will miss out on exact
>   ;; positions.  Allowing `foo' would hit too many false matches
>   ;; for things that should go to Function: etc, and those latter
>   ;; are much more important.  Perhaps this could change if some
>   ;; sort of fallback match scheme existed.
>   ("(elisp)Index"                        nil "^ -+ .*: " "\\( \\|$\\)")
>   ("(info)Index"                         nil "^ -+ .*: " "\\( \\|$\\)")
>   ("(efaq-w32)Indexes"                   nil "^ -+ .*: " "\\( \\|$\\)")
>   ("(eintr)Index"                        nil "^ -+ .*: " "\\( \\|$\\)")
>   ("(ccmode)Command and Function Index"  nil "^ -+ .*: " "\\( \\|$\\)")
>   ("(ccmode)Variable Index"              nil "^ -+ .*: " "\\( \\|$\\)")
> [...]

Wouldn't it make much more sense to make the :regexp attribute more
specialized for the non-core manuals?  AFAIU, your proposal will
greatly slow down "C-h S" in emacs-lisp-mode, because of the need to
scan many more indices, and for no good reason AFAICT.

> ["(efaq-w32)Indexes" should probably be included conditionally, for MS
> Windows.  And perhaps on other platforms `emacs -Q' gives a different
> set of manuals, so other adjustments could be made.]

That would be sub-optimal, IMO, because questions specific to certain
platforms can be asked and answered by people who run on other
platforms.  Instead, we should be more selective in the regexps that
match symbols; for example, a symbol that starts with "w32-" should
trigger search in efaq-w32 as well.