baszoetekouw / pinfo Goto Github PK
View Code? Open in Web Editor NEWConsole-based info reader
License: GNU General Public License v2.0
Console-based info reader
License: GNU General Public License v2.0
Apparently u
is fixed at going a node up, regardless of what I bind it to...
To look up the coreutils introduction I can do:
$ info coreutils intro
⋮
-----Info: (coreutils)Introduction, 40 lines --All----------------------
There's apparently no easy way to do the same thing in pinfo:
$ pinfo coreutils intro
File: coreutils.info, Node: Top, Next: Introduction, Up: (dir)
⋮
$ pinfo coreutils -n intro
Przemek's Info Viewer v0.6.13
Searching for tag table done
Specified node does not exist...
-n
could work, but only if you spell the whole node name, which is inconvenient:
$ pinfo coreutils -n Introducution
File: coreutils.info, Node: Introduction, Next: Common options, Prev: Top, Up: Top
⋮
Such as KEY_SEARCH_BACKWARD
as well as scrolling half pages
With gcc-8.3.0:
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -D_XOPEN_SOURCE=600 -Wall -Wextra -Wshadow -Werror -DLOCALEDIR=\"/usr/share/locale\" -DCONFIGDIR=\"/etc/pinforc\" -O3 -march=native -mlwp -pipe -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -c -o pinfo-utils.o `test -f 'utils.c' || echo './'`utils.c
utils.c: In function ‘getstring_with_completion’:
utils.c:372:62: error: unused parameter ‘completions’ [-Werror=unused-parameter]
getstring_with_completion(char *prompt, const char * const * completions)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
Hey, I'd really like to use this instead of info, but some things hold me back:
info
has a --vi-keys
option which I much prefer, handbinding all of pinfo
's keys appropriately seems a bit overcomplicated, especially since the binding system is weird: Instead of attaching actions to keys, which prevents double-binding a key and allows multiple keys for the same command, this program assigns keys to actions, which I have never seen before.
In manuals, the formatting seems lacklustered, especially boldness is missing, maybe related to sharkdp/bat#652 ?
Compilation error on macOS Catalina 10.15.5:
utils.c:372:62: error: unused parameter 'completions' [-Werror,-Wunused-parameter]
getstring_with_completion(char *prompt, const char * const * completions)
^
1 error generated.
The error seems happen since the usage of the parameter completions is hidden by an ifdef:
#ifdef HAS_READLINE
completion_values = completions;
[...]
The call to the man program has man -W and there is no option for man -W causing an error.
In manual.c at line 185 looks like the problem:
snprintf(buf, sizeof(buf), "man -w -W %s %s", ManOptions, name);
Maybe -C for configuration. This is a problem when the info page is not found.
1.When used on ls in coreutils, strace shows that pinfo goes looking for invalid files such as coreutils.gz instead of coreutils.info.gz, and fails to display the info node. This doesn't always happen though, and depends on whether pinfo looked up another .info file prior to this.
When the node link spans multiple lines and contain repeating spaces due to the margin, following the link fails. This happens for example for this link: ls->What information is listed->Formatting the file names
When a man page is looked up without specifiying its section, and if it contains a link to a man page with the same name but in a different section, the link is ignored. This happens for example sleep(1) which has a link to sleep(3).
The attached patch addresses these issues.
pinfo_patch.txt
pinfo currently only
supports Node hyperlinks and not Anchors (see
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Info-Format-Tag-Table.html
for the difference between those). Specifically, pinfo assumes all
links are to Nodes, and so after seeking to the correct file position,
it looks for the first new Node below.
Bug reproducible in cpp-6 info page, Node: Implementation-defined behavior, first link.
From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=369120
When exiting pinfo in my Terminal, the scrollback is cleared and the terminal is reset, which I find irritating.
Confirmed in Alacritty and Konsole running zsh.
I get the following error when running automake --add-missing --copy --force-missing
(started automatically from autoreconf -fiv
:
doc/Makefile.am:4: error: option 'info-in-builddir' not recognized
Man and info pages often contain file paths and sometimes URLs.
It would be handy if these could be recognized such that they could be cycled through and followed.
Files should then probably be opened using $PAGER
.
Compilation error on Red Hat Enterprise Linux Workstation release 7.5 (Maipo):
manual.c: In function 'add_highlights':
manual.c:1866:16: error: 'uint64_t' undeclared (first use in this function); did you mean 'u_int64_t'?
else if ((uint64_t) (wskend-tmpstr)<manualcol) /* should be safe see check above */
^~~~~~~~
u_int64_t
I was able to fix it by adding this line to the top of manual.c
:
#include <stdint.h>
Hi,
A packaging effort of the most recent commit in Guix resulted in the error below.
I believe, but did not confirm, that the conflicting symbol definitions are caused by the duplicated declaration of extern int use_manual
in datatypes.h and parse_config.h. Both files are included everywhere via common_includes.h, so I might personally attempt to remove one of the declarations.
Thanks for maintaining this software!
Kind regards,
Felix Lechner
/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash ../libtool --tag=CC --mode=link gcc -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -Wall -Wextra -Wshadow -DLOCALEDIR=\"/gnu/store/5z12c5zw9sy8m732xhilnpj40318g9h0-pinfo-0.6.13/share/locale\" -DCONFIGDIR=\"/gnu/store/5z12c5zw9sy8m732xhilnpj40318g9h0-pinfo-0.6.13/etc/pinforc\" -g -O2 -D_XOPEN_SOURCE=600 -o pinfo pinfo-pinfo.o pinfo-colors.o pinfo-datatypes.o pinfo-filehandling_functions.o pinfo-mainfunction.o pinfo-manual.o pinfo-menu_and_note_utils.o pinfo-parse_config.o pinfo-regexp_search.o pinfo-signal_handler.o pinfo-utils.o pinfo-video.o pinfo-initializelinks.o pinfo-printinfo.o readlinewrapper.o -lncursesw
libtool: link: gcc -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -Wall -Wextra -Wshadow -DLOCALEDIR=\"/gnu/store/5z12c5zw9sy8m732xhilnpj40318g9h0-pinfo-0.6.13/share/locale\" -DCONFIGDIR=\"/gnu/store/5z12c5zw9sy8m732xhilnpj40318g9h0-pinfo-0.6.13/etc/pinforc\" -g -O2 -D_XOPEN_SOURCE=600 -o pinfo pinfo-pinfo.o pinfo-colors.o pinfo-datatypes.o pinfo-filehandling_functions.o pinfo-mainfunction.o pinfo-manual.o pinfo-menu_and_note_utils.o pinfo-parse_config.o pinfo-regexp_search.o pinfo-signal_handler.o pinfo-utils.o pinfo-video.o pinfo-initializelinks.o pinfo-printinfo.o readlinewrapper.o -lncursesw
ld: pinfo-colors.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-datatypes.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-filehandling_functions.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-mainfunction.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-manual.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-menu_and_note_utils.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-parse_config.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-regexp_search.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-signal_handler.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-utils.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-video.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-initializelinks.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: pinfo-printinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
ld: readlinewrapper.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: multiple definition of `use_manual'; pinfo-pinfo.o:/tmp/guix-build-pinfo-0.6.13.drv-0/source/src/parse_config.h:88: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:527: pinfo] Error 1
make[2]: Leaving directory '/tmp/guix-build-pinfo-0.6.13.drv-0/source/src'
make[1]: *** [Makefile:477: all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-pinfo-0.6.13.drv-0/source'
make: *** [Makefile:407: all] Error 2
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "8") exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 2.1 seconds
command "make" "-j" "8" failed with status 2
First of all, congratulations for what you have done with pinfo
! Using VERBOSE=false
in /etc/pinforc
is very valuable because it saves readings, little nuisances (and finally time) to people, although a bug (which seems to be easy to resolve 🙂) appears: then using pinfo --version
shows nothing. Answering what the user asks is not verbosity 🙂. Thank you very much, Bas!
I am writing a script where I would like to view info pages with pinfo, but no man pages.
Currently I see no switch to restrict pinfo to info pages.
How to trigger:
src/pinfo -m python2 -c 'print "A"*558'
Output
Przemek's Info Viewer v0.6.10
Looking for man page...
Caught signal 11, bye!
pinfo: crash with: No such file or directory
Register Dump
[----------------------------------registers-----------------------------------]
RAX: 0x54 ('T')
RBX: 0x20414141414141 ('AAAAAA ')
RCX: 0x8a0
RDX: 0x10
RSI: 0x0
RDI: 0x7f72f8c7b8a0 --> 0x727245004d524554 ('TERM')
RBP: 0x7fffffffdcf8 --> 0x20414141414141 ('AAAAAA ')
RSP: 0x7fffffffd6b0 --> 0x7f72f8c7b8a0 --> 0x727245004d524554 ('TERM')
RIP: 0x7f72f88bac95 (<getenv+165>: cmp r12w,WORD PTR [rbx])
R8 : 0x0
R9 : 0x20 (' ')
R10: 0x524
R11: 0x7f72f88babf0 (: push r15)
R12: 0x4554 ('TE')
R13: 0x7f72f8c7b8a2 --> 0x726f727245004d52 ('RM')
R14: 0x4
R15: 0x2
EFLAGS: 0x10206 (carry PARITY adjust zero sign trap INTERRUPT direction overflow)
[-------------------------------------code-------------------------------------]
Stack Dump
[------------------------------------stack-------------------------------------]
0000| 0x7fffffffd6b0 --> 0x7f72f8c7b8a0 --> 0x727245004d524554 ('TERM')
0008| 0x7fffffffd6b8 --> 0x0
0016| 0x7fffffffd6c0 --> 0x7fffffffd700 --> 0x7fffffffd9e0 --> 0x7fffffffdbf0 ('A' <repeats 200 times>...)
0024| 0x7fffffffd6c8 --> 0x555555556e90 (<_start>: xor ebp,ebp)
0032| 0x7fffffffd6d0 --> 0x7fffffffdcd0 ('A' <repeats 46 times>, " ")
0040| 0x7fffffffd6d8 --> 0x0
0048| 0x7fffffffd6e0 --> 0x0
0056| 0x7fffffffd6e8 --> 0x7f72f8c4bca1 (<initscr+49>: test rax,rax)
[------------------------------------------------------------------------------]
Call Stack Trace
#0 0x00007f72f88bac95 in getenv () from /usr/lib/libc.so.6
#1 0x00007f72f8c4bca1 in initscr () from /usr/lib/libncursesw.so.6
#2 0x0000555555569d58 in init_curses () at utils.c:285
#3 0x0000555555560ea5 in handlemanual (name=0x7fffffffdad0 'A' <repeats 200 times>...) at manual.c:266
#4 0x00005555555574bb in main (argc=0x3, argv=0x7fffffffdcd8) at pinfo.c:205
I am working on a patch for this, which will be submitted once done.
README says:
old project page is still available at http://pinfo.sourceforge.net/.
But apparently that page is gone now; it unhelpfully redirects to https://sourceforge.net/directory/development/editors-documentation/.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.