On Wed, Jul 16, 2025 at 04:19:53PM +0200, Patrice Dumas wrote: > On Wed, Jul 16, 2025 at 12:57:03AM +0100, Gavin Smith wrote: > > This feature still needs work: > > > > * At what point do we run the hook - before checking for man pages, > > or after? E.g. if "tar.info" is not installed but the tar man page > > is installed, should "info tar" run the hook, or display the man > > page (or somehow run the hook and then display the man page afterwards)? > > More than one hook, or options passed to hooks, might be necessary to > > accommodate all the possibilities. > > My feeling is that links to man pages as primary source of information > is rare (except when already in a man page), in general man pages are used > when an info manual is missing. So my advice would be to run the hook > first and display the man page afterwards. > > We could also provide some code that checks for the man page existence > like info would do, such that hook writers can use that code to return > without doing anything in case they prefer man pages.
Yes that makes sense - check for the existence of the man page before calling the hook, and pass this information to the hook. I'm currently working on code to capture the output of a hook and create an Info node from it. (It would be a transient node like the help node or the results of an index search.) I think we should also support a hook for a failure to find a manual when following a cross-reference when using Info interactively, for the same reasons: e.g. if you are reading the 'automake' manual and then try to follow a link to '(autoconf)Top', it's less than idea to be dumped at the man page or told that the manual doesn't exist. A hook could generate a node with an Info menu with a reference to the man page (using the '(*manpages*)PAGE' syntax). > > > * Do we want to provide a default implementation of the hook referring > > users to download manuals from <https://www.gnu.org/manual/manual.html>? > > I am not sure that it would be right to do that on all platforms. On > platforms with packaging systems this is probably not a good advice. On > platforms without packaging systems, this could make sense. > > Maybe the default hook could be a configure option? Yes, something like that. I'm a little hazy on how default configuration files should be installed but we could work out the details once the feature is done. > In any case, we could provide code snippets (if relevant) and ideas to > hook writers to lower as much as possible the bar to make use of the > feature. > > -- > Pat
