Giter Club home page Giter Club logo

pinfo's Introduction

Pinfo is user-friendly, console-based viewer for Info documents. Hope you like it :)

Until version 0.6.8, Pinfo was maintained by Przemek Borys. His old project page is still available at http://pinfo.sourceforge.net/. Unfortunately, Przemek is no longer active, and development was taken over by Bas Zoetekouw and moved to Alioth: https://alioth.debian.org/projects/pinfo/. Since 2014 (version 0.6.10), development has moved to Github: https://github.com/baszoetekouw/pinfo

See man page (pinfo.1) for details.

Copyright (C) 1999       Przemek Borys <[email protected]>
Copyright (C) 2005-2006  Bas Zoetekouw <[email protected]> 
                         Nathanael Nerode <[email protected]>
Copyright (C) 2007-2016  Bas Zoetekouw <[email protected]> 

This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

pinfo's People

Contributors

baszoetekouw avatar jwilk avatar trofi avatar xaizek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pinfo's Issues

pinfo occasionally fails to find some nodes.

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.

  1. 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

  2. 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

Support for anchor hyperlinks

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

Duplicate declaration of 'extern int use_manual'

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

Menu lookup

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

Clears scrollback after exit

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.

Recognize URLs and file paths

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.

CLI switch to read only info pages

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.

pinfo --version

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!

pinfo-0.6.13 build failure due to "-Werror"

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)
                                         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

Compilation error (macOS): unused parameter

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;
[...]
  • Apple clang version 11.0.0 (clang-1100.0.33.17)
  • Target: x86_64-apple-darwin19.5.0

Undeclared type uint64_t

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>
  • RHEL 7.5
    • gcc 4.8.5
    • glibc 2.17

Vi keys

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.

Showing man page fails when info not found

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.

Improper buffer handling resulting in overflow which leads to crash

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.

Automake Error (RHEL 7.5)

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

  • Red Hat Enterprise Linux Workstation release 7.5 (Maipo)
    • autoconf 2.69
    • automake 1.13.4
    • libtool 2.4.2
    • gettext-devel 0.19.8.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.