Hello GNU,

To give some context to my question, I want to have an info reader in Vim 
(Neovim actually, but it should work in both), similar to Emacs’s info-mode. I 
have looked at how Emacs does it and from the looks of it, it re-implements the 
entire standalone reader in Emacs Lisp. That’s certainly a way to do it, but 
it’s a lot of duplicate work when the standalone info reader already knows 
everything about info files. Here is my plugin repository so far:
https://gitlab.com/HiPhish/info.vim

So I was planning on leveraging the standalone info as a sort of file 
processor: you send it parameters of what you want and you receive the 
formatted output back. Let’s say I want to read the introduction to Bash:

        > info bash introduction --output - 2>/dev/null

This works fine, I can read that into a buffer. I can also specify an entire 
path:

        > info bash introduction 'what is bash?' --output - 2>/dev/null

That’s half of the reader already. However, the other half is finding my way 
around the file. References and menus are fairly simple to parse, but how do I 
get what they point to? This is where the standalone info fails, I cannot do 
something like this:

        > info bash --x-ref 'foo bar'

and get back the name of the node plus line number. Similarly, if I want to 
search the index for something I would like to pass this to the shell:

        > info bash --index 'foo bar'

and get back a grep-like listing of where this occurs in the file. In my Vim 
plugin I am using a URI for specifying locations in the info file (see the 
HACKING in my repo for details):

        info://file-name/node-1/node-2/

I don’t expect info to return a URI like that back to me (although that would 
be pretty cool), but I should have enough information to assemble it. A line 
number can be given as a fragment or query within the URI. And of course if 
someone has suggestions for a better URI I’m all ear.


So I guess the bottom line of my question is, can standalone info be used in 
such a way that I can call it to get information for navigation back from it? 
And if not, can we extend it? I am a C programmer, but I don’t know my way 
around Texinfo, that’s why I’m asking first.

Reply via email to