lynx-style info browser


SUBMITTED BY: Guest

DATE: June 2, 2014, 1:47 p.m.

FORMAT: Text only

SIZE: 17.8 kB

HITS: 5888

  1. NAME
  2. pinfo - curses based lynx-style info browser
  3. SYNTAX
  4. pinfo [options] [infopage]
  5. DESCRIPTION
  6. This is a program for viewing info files. You specify which page you want to read by passing it an infopage argument. This argument contains the name of an info page (i.e. 'bash'). The program will then (by default) search for it in ./, /usr/info, /usr/share/info, and /usr/local/info. The searchpath can be adjusted by INFOPATH environment variable or in config file. Pinfo will also automaticaly add the suffix '-info', '-info.Z', '-info.gz', or '-info.bz2'. At present other suffixes are not recognized, but you can easily add them to the function openinfo() in filehandling_functions.c. When the search for info pages fails, man is called with the infopage argument, and it's output is parsed by pinfo. This means that when you don't have the appropriate info page, but have a man page instead; the man page will be viewed. When no infopage is specified, the default `dir' page is shown. Supported options are -h, --help - print help information and exit. -v, --version - print version information and exit. -m, --manual - uses manual page instead of info by default. (pinfo -m could be used as a manual pager). Warning: Everything what follows this option is passed to the `man' program. Don't be confused if pinfo options, which followed `-m' don't work. When using this option, pinfo does not parse the info options as ussual! It invokes the man part of program. You can also call the man function of pinfo in another way. When pinfo is called with an argv[0] (the program file name), which contains the word 'man' in it's name, the man functions are enabled automatically. Previously there was a symlink to pinfo, called pman, but I had to remove it from the distribution, since it's name was in conflict with some other utility. Anyway, you can feel free to create such a link if you wish. -r, --raw-filename - uses a raw filename first (i.e. the name which you specified as infopage is considered to be a real file in the specified location). -f, --file synonym for -r. -a, --apropos - if this is set, apropos is called when no man or info page could be found. -c, --cut-man-headers - if this is set, man parsing code will try to cut out the repeated man headers. Use with care. ;) -s, --squeeze-lines- cut empty lines from manual pages. This option enables autocutting of every repeated newline in a manual page. -t, --force-manual-tag-table- forces manual detection of tag table. This allows you to view info pages, which may be corrupted. (as i.e. version of jed's pages, shipped with RH5.0). The tag table corruption ussualy appears in that the info links, which you follow, move you to quite unexpected nodes. --node=nodename, --node nodename- Go to the node `nodename' of info file. Since 0.6.7 it is also possible to specify nodes as in standalone info via filenames, like `(gcc)Introduction'. --rcfile=filename, --rcfile filename- Use alternate rcfile. --long-manual-links, -l- Use long link names in manuals. On some systems the manual hierarchy is divided into subsections like `3ncurses', etc, while on other systems all belongs to section `3'. If this option is what your system is like, feel free to use it. --clear-at-exit, -x- Clear screen at exit. The options are handled by GNU getopt, so you can here (as in other programs) abbreviate the option names to the minimal number of characters by which the options differ. Warning! If you do not have getopt, these options will not work!
  7. DEFAULT KEYS WHEN BROWSING INFO FILE
  8. Just take a look at the example config file (below), and at the key descriptions. Keys available in manual viewer differ a bit from the keys available in info viewer.
  9. ENVIRONMENT
  10. There is a variable $INFOPATH, which can specify the paths to be searched for info files. It's format is similar to that of the $PATH variable. An example setting could look like: /usr/info:/usr/somewhere/info:/not/even/in/usr/info etc. Directories are separated by colons.
  11. COLOR AND KEY DEFINITIONS
  12. There are configuration files called ~/.pinforc and [prefix]/etc/pinforc, for local and global configuration (where prefix is the prefix of the directory, where pinfo is installed, i.e. /usr/local, or /). Here's an example of such a file; we'll discuss the contents below:
  13. # Here are some colour setting.
  14. # Whitespace between the entries is optional.
  15. COL_NORMAL = COLOR_WHITE, COLOR_BLACK, NO_BOLD, NO_BLINK
  16. COL_MENUSELECTED = COLOR_RED, COLOR_BLACK, BOLD, NO_BLINK
  17. COL_MENU=COLOR_BLUE,COLOR_BLACK,BOLD, NO_BLINK
  18. COL_NOTESELECTED=COLOR_RED,COLOR_BLACK,BOLD, NO_BLINK
  19. COL_NOTE=COLOR_GREEN,COLOR_BLACK,BOLD, NO_BLINK
  20. COL_TOPLINE=COLOR_YELLOW,COLOR_BLUE,BOLD, NO_BLINK
  21. COL_BOTTOMLINE=COLOR_YELLOW,COLOR_BLUE,BOLD, NO_BLINK
  22. COL_MANUALBOLD=COLOR_WHITE,COLOR_BLACK,BOLD, NO_BLINK
  23. COL_MANUALITALIC=COLOR_WHITE,COLOR_BLACK,BOLD, NO_BLINK
  24. COL_URL=COLOR_MAGENTA,COLOR_BLACK,BOLD, NO_BLINK
  25. COL_URLSELECTED=COLOR_RED,COLOR_BLACK,NO_BOLD, NO_BLINK
  26. COL_INFOHIGHLIGHT=COLOR_WHITE,COLOR_BLACK,BOLD, NO_BLINK
  27. #
  28. # Here are some keybindings as well...
  29. #
  30. KEY_TOTALSEARCH_1 = 's'
  31. KEY_TOTALSEARCH_2 = 'S'
  32. KEY_SEARCH_1 = '/'
  33. KEY_SEARCH_2 = '.'
  34. KEY_GOTO_1='g'
  35. KEY_GOTO_2='m'
  36. KEY_HOME_1='h'
  37. KEY_HOME_2='H'
  38. KEY_PREVNODE_1='p'
  39. KEY_PREVNODE_2='P'
  40. KEY_NEXTNODE_1='n'
  41. KEY_NEXTNODE_2='N'
  42. KEY_UP_1=KEY_UP
  43. KEY_UP_2='u'
  44. KEY_END_1=KEY_END
  45. KEY_END_2='e'
  46. KEY_PGDN_1=KEY_NPAGE
  47. KEY_PGDN_2=' '
  48. KEY_PGDN_AUTO_1=0
  49. KEY_PGDN_AUTO_2=' '
  50. KEY_PGUP_1=KEY_PPAGE
  51. KEY_PGUP_2='b'
  52. KEY_PGUP_AUTO_1=0
  53. KEY_PGUP_AUTO_2='b'
  54. KEY_DOWN_1=KEY_DOWN
  55. KEY_DOWN_2='d'
  56. KEY_TOP_1=KEY_HOME
  57. KEY_TOP_2='t'
  58. KEY_BACK_1=KEY_LEFT
  59. KEY_BACK_2='l'
  60. KEY_FOLLOWLINK_1=KEY_RIGHT
  61. KEY_FOLLOWLINK_2='
  62. # 12 is a code for ctrl+l
  63. KEY_REFRESH_1=12
  64. KEY_REFRESH_2='~'
  65. KEY_SHELLFEED_1='!'
  66. KEY_SHELLFEED_2='1'
  67. KEY_QUIT_1='q'
  68. KEY_QUIT_2='Q'
  69. KEY_DIRPAGE_1='d'
  70. KEY_DIRPAGE_2='D'
  71. KEY_GOLINE_1='l'
  72. KEY_GOLINE_2=0
  73. KEY_PRINT_1=']'
  74. KEY_PRINT_2=0
  75. #
  76. # Some options, explained in the man page
  77. #
  78. MANUAL=false
  79. CUT-MAN-HEADERS=true
  80. CUT-EMPTY-MAN-LINES=true
  81. RAW-FILENAME=false
  82. APROPOS=false
  83. DONT-HANDLE-WITHOUT-TAG-TABLE=false
  84. LONG-MANUAL-LINKS=false
  85. FILTER-0xB7=true
  86. QUIT-CONFIRMATION=false
  87. QUIT-CONFIRM-DEFAULT=no
  88. CLEAR-SCREEN-AT-EXIT=true
  89. STDERR-REDIRECTION="2> /dev/null"
  90. HTTPVIEWER=lynx
  91. FTPVIEWER=lynx
  92. MAILEDITOR=pine
  93. MANLINKS=1:8:2:3:4:5:6:7:9:n:p:o:3X11:3Xt
  94. INFOPATH=/usr/info:/usr/share/info:/usr/local/info
  95. HIGHLIGHTREGEXP=Bash.*has
  96. SAFE-USER=nobody
  97. SAFE-GROUP=nobody
  98. As you can see, the format is simple. First I'll explain the color definitions. First you must enter a color name (all available color names are present in the example, and they're self explanatory, I think. There is also a special color COLOR_DEFAULT, which stands for transparency). Then you enter the foreground color, and the background color. The BOLD attribute means that we want the foreground color to be highlighted. (i.e. lightblue, lightgreen). BLINK attribute is the blinking attribute, or highlighted background in some other configurations. Now let's move to the key definitions. Here we first put a key name (again all keys are present in the example); then we enter it's value -- either surrounded by apostrophes, or a keycode number (like in KEY_REFRESH_1), or its mnemonic code name if it's a special key (like i.e. in KEY_FOLLOWLINK_1). If you wish to specify key by code value, use the supplied program 'testkey' to obtain the needed value. It mainly is a feature, when you want to add some ctrl+letter keybindings, and similar. For each function you can bind two keys, i.e. you could bind both Enter and Cursor Right to the FollowLink-function. As you can see in the example above, the two key names are KEY_FOLLOWLINK_1 and KEY_FOLLOWLINK_2. Here's an explanation of the key names:
  99. KEY_TOTALSEARCH_1
  100. Key for searching through all nodes of info file.
  101. KEY_TOTALSEARCH_2
  102. Alternate key for searching through all nodes of info file.
  103. KEY_SEARCH_1
  104. Key for searching through current node (or manual).
  105. KEY_SEARCH_2
  106. Alternate key for searching through current node (or manual).
  107. KEY_SEARCH_AGAIN_1
  108. Key for repeating the last search.
  109. KEY_SEARCH_AGAIN_2
  110. Alternate key for repeating the last search.
  111. KEY_GOTO_1
  112. Key for explicitly going to a node (by specifing it's name).
  113. KEY_GOTO_2
  114. Alternate key for explicitly going to a node (by specifing it's name).
  115. KEY_PREVNODE_1
  116. Key for going to a node marked as 'Prev' in the header. In manpage viewer this goes to the previous man section.
  117. KEY_PREVNODE_2
  118. Alternate key for going to a node marked as 'Prev' in the header. In manpage viewer this goest to the previous man section.
  119. KEY_NEXTNODE_1
  120. Key for going to a node marked as 'Next' in the header. In manpage viewer this goes to the next man section.
  121. KEY_NEXTNODE_2
  122. Alternate key for going to a node marked as 'Next' in the header. In manpage viewer this goes to the next man section.
  123. KEY_UP_1
  124. Key for scrolling text one line up.
  125. KEY_UP_2
  126. Alternate key for scrolling text one line up.
  127. KEY_END_1
  128. Key for going to the end of the node.
  129. KEY_END_2
  130. Alternate key for going to the end of the node.
  131. KEY_PGDN_1
  132. Key for going one page down in the viewed node.
  133. KEY_PGDN_2
  134. Alternate key for going one page down in the viewed node.
  135. KEY_PGDN_AUTO_1
  136. Key for going to the next node when you're at the end of node (default is zero -- turned off).
  137. KEY_PGDN_AUTO_2
  138. Alternate key for going to the next node when you're at the end of node (default is space, as for pgdn_2).
  139. KEY_HOME_1
  140. Key for going to the beginning of the node.
  141. KEY_HOME_2
  142. Alternate key for going to the beginning of the node.
  143. KEY_PGUP_1
  144. Key for going one page up in the viewed node.
  145. KEY_PGUP_2
  146. Alternate key for going one page up in the viewed node.
  147. KEY_PGUP_AUTO_1
  148. Key for going to the `up' node, when being at the top of node. (Default value is zero -- turned off).
  149. KEY_PGUP_AUTO_2
  150. Alternate key for going to the `up' node, when being at the top of node. (Default value is `-', as for pgup_2).
  151. KEY_DOWN_1
  152. Key for scrolling the text down one line.
  153. KEY_DOWN_2
  154. Alternate key for scrolling the text down one line.
  155. KEY_TOP_1
  156. Key for going to the top (first) node.
  157. KEY_TOP_2
  158. Alternate key for going to the top (first) node.
  159. KEY_BACK_1
  160. Key for going back (in the history of viewed nodes).
  161. KEY_BACK_2
  162. Alternate key for going back (in the history of viewed nodes).
  163. KEY_FOLLOWLINK_1
  164. Key for following a hypertext link.
  165. KEY_FOLLOWLINK_2
  166. Alternate key for following a hypertext link.
  167. KEY_REFRESH_1
  168. Key for refreshing the screen (hardcoded is the ^L value).
  169. KEY_REFRESH_2
  170. Alternate key for refreshing the screen.
  171. KEY_SHELLFEED_1
  172. Key for calling a shell command, and passing the viewed node to the stdin of that command.
  173. KEY_SHELLFEED_2
  174. Alternate key for calling a shell command, and passing the viewed node to the stdin of that command.
  175. KEY_QUIT_1
  176. Key for exiting the program.
  177. KEY_QUIT_2
  178. Alternate key for exiting the program.
  179. KEY_GOLINE_1
  180. Key for going to a specified line in file.
  181. KEY_GOLINE_2
  182. Alternate key for going to a specified line in file.
  183. KEY_PRINT_1
  184. Key for printing viewed node or man page.
  185. KEY_PRINT_2
  186. Alternate key for printing viewed node or man page.
  187. The special mnemonics for keys (which are defined at present) are:
  188. KEY_BREAK
  189. KEY_DOWN
  190. KEY_UP
  191. KEY_LEFT
  192. KEY_RIGHT
  193. KEY_DOWN
  194. KEY_HOME
  195. KEY_BACKSPACE
  196. KEY_NPAGE
  197. KEY_PPAGE
  198. KEY_END [Note: this works probably ONLY with linux ncurses]
  199. KEY_F(x)
  200. KEY_CTRL('c')
  201. - this assigns the key value to a ctrl+c combination. c may be any letter you wish.
  202. KEY_ALT('c')
  203. - this assigns the key value to a alt+c combination. c may be any letter you wish. If alt key won't work, you may use ESC+key combination.
  204. 'c'
  205. - this means a printable character c. The syntax is just like in C/C++ ;).
  206. [number]
  207. - you can also specify key as it's code number. It is useful e.g. when specifing control keys, and some nonstandard keys. A numerical value of zero turns given keybinding off.
  208. See manual page for curs_getch (3x) for description of their meaning. Warning! Try not to create some serious keybinding conflicts! The options in the last part of the example configuration file should be fairly self-explanatory. The variables that can be set to true or false do the same things as the commandline arguments with the same names.
  209. MANUAL
  210. If this is set to true the default is to first check for a man page, instead of a texinfo file.
  211. CUT-MAN-HEADERS
  212. If set to true, then pinfo tries to cut off the repeated headers throughout man pages.
  213. CUT-EMPTY-MAN-LINES
  214. If set to true, then pinfo tries to cut off the repeated newlines (i.e. it will shorten each set of consecutive newlines to one newline).
  215. RAW-FILENAME
  216. If set to true, the file argument is taken to be the name of a file in the current working directory, i.e. the directories in INFOPATH will only be searched if a file with this name is not in the working directory.
  217. APROPOS
  218. If set to true, apropos is called if no info or man page is found.
  219. DONT-HANDLE-WITHOUT-TAG-TABLE
  220. If set to true , pinfo will not attempt to display texinfo pages without tag tables.
  221. HTTPVIEWER
  222. Set this to the program you want to use to follow http links in documents.
  223. FTPVIEWER
  224. Set this to the program you want to use to follow ftp links in documents.
  225. MAILEDITOR
  226. Set this to your favourite email program, and it will be started if you follow an email link in a document.
  227. PRINTUTILITY
  228. Utility, which you use for printing. I.e. `lpr'. If you don't use any, you may also try something like `cat >/dev/lp1', or sth. ;)
  229. MANLINKS
  230. This specifies the section names, which may be referenced in your man pages (i.e. Xtoolkit man pages match the section 3Xt (see for example XtVaCreateWidget) manpage), Xlib function pages match section 3X11, etc. Such extensions may not be recognized by default, so it is a good idea to add them).
  231. INFOPATH
  232. This allows you to override the default searchpath for info pages. The paths should be separated by colons.
  233. MAN-OPTIONS
  234. This specifies the options, which should be passed to the `man' program. (see man(1) for description of what they're like).
  235. STDERR-REDIRECTION
  236. Pinfo allows you to redirect the stderr output of called programms. For example if you don't want to see man's error messages about manual page formatting, you can use STDER-REDIRECTION="2> /dev/null". This is the default.
  237. LONG-MANUAL-LINKS
  238. This is another true/false option, which decides whether your system supports long manual section names, or not. (i.e. "3ncurses" instead of "3").
  239. FILTER-0xB7
  240. This decides, whether you want to convert 0xb7 chars to `o', or not. For example for iso-8859-2 fonts this makes man's list marks a bit nicer ;) (look for example at perl's man page, to see how those marks look like).
  241. QUIT-CONFIRMATION
  242. This decides whether you want to use quit confirmation on exit, or not.
  243. QUIT-CONFIRM-DEFAULT
  244. This yes/no option determines the default answer to the QUIT-CONFIRMATION dialog. (default answer is when you press a key, that does not match the asked question).
  245. CLEAR-SCREEN-AT-EXIT
  246. This true/false option determines if you want to have your screen cleared at exit, or no.
  247. CALL-READLINE-HISTORY
  248. This true/false option determines if you want to have a prompt of last history entry whenever calling readline wrapper, eg. in subsequent searches.
  249. HIGHLIGHTREGEXP
  250. This is an option, through which you may pass to pinfo regexps, which should be highlighted when working with document. Warning! This may turn very slow if you use it without care!
  251. SAFE-USER
  252. This option is used to pass the name of user, to which suid when pinfo is run with root privileges.
  253. SAFE-GROUP
  254. This option is used to pass the name of group, to which suid when pinfo is run with root privileges.
  255. INTERNATIONALIZATION SUPPORT
  256. Pinfo implements general features of gnu gettext library (the thing, which you need to see national messages ;). But it is not the end. Pinfo allows you to use national info pages! You only need to put them to your info directory, into a subdirectory, which is called `$LANG'.
  257. LICENSE
  258. This program is distributed under the terms of GPL.
  259. BUGS
  260. Please send bug reports to the author.
  261. AUTHOR
  262. Przemek Borys

comments powered by Disqus