On Wed, 14 Oct 2020 12:06:48 -0700 Stefan Kangas wrote: > larsi@gnus.org (Lars Ingebrigtsen) writes: > >> +*** New keybinding in 'help-for-help' to display a manual. >> +The 'R' keybinding after 'C-h C-h' will prompt for a manual name and >> +then display it. > > Shouldn't this NEWS entry rather say something like: > > * New keybinding 'C-h R' prompts for a manual display and displays it. > > Testing the command, the completion is a bit unsatisfactory. It doesn't > seem to prompt for a manual name, but a file name? Or maybe it allows > both? I see all of "gnus", "gnus.info" and "gnus.info.gz" in the > completion list, yet they all seem to lead to the same manual. I also > see ".", ".." and a directory "emacs/". ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ These last three are due to this bit in Info-read-node-name-2: ;; If the file name has no suffix or a standard suffix, ;; include it. (and (or (null (file-name-extension file)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (string-match suffix file)) And it's even worse if Info-directory-list includes directories that contain lots of extensionless files that aren't info files, such as, for example, the AUCTeX package from GNU ELPA, which contains such files as ChangeLog, COPYING, GNUmakefile, etc., all of which are listed in the *Completions* buffer, and if you choose one of them, it gets visited in Info mode, which throws the user-error: "No such node or anchor: Top". An odd thing about Info-read-node-name-2 is that it explicitly removes the empty string from Info-suffix-list but then in effect adds it back by checking for extensionless files in the above code. I checked the info files installed on my system and all of them end in ".info" or "info.gz" (in some cases followed by a dash and a number, indicating split info subfiles, see below). And also in the Emacs source all info files under info/ end in ".info". Are there known cases of extensionless info files that do not correspond to a file ending in ".info" or ".info.gz" (or another compression suffix)? If not, then removing that bit of the code will prevent the current false positives. In addition, Info-read-node-name-2 excludes subfiles of split info files only where these are extensionless files ending in the regexp "-[0-9]+", but this misses files which have the number before a compression extension, of which my system has several, e.g. R-exts.info-3.gz. However, in all cases on my system, split info files contain "info" before "-[0-9]+", and if that's always the case, then the patch below will make tab completion on info-display-manual (i.e. `C-h R') show all info files without shwoing the .info extension and also excluding numbered subfiles and false positives. Granted this is still not the manual name as shown in the top level Info directory but only the extensionless file name, e.g. "eintr" instead of "Emacs Lisp Intro", but at least it seems better than the status quo (if the assumption that all info files include the ".info" extension is correct). Steve Berman