bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Improving standalone info usability


From: Gavin Smith
Subject: Improving standalone info usability
Date: Thu, 30 Jan 2014 16:19:26 +0000

Documentation in the standalone info browser feels slightly messy. I
believe the reason for this is that it is displaying the contents of
the info file mostly verbatim, including any notation that is intended
to be read by a computer rather than a person.

The three main instances of this:

1. The header line: For example, "File: bash.info,  Node: Top,  Next:
Introduction,  Prev: (dir),  Up: (dir)". This tells the program the
name of the node and links to neighbouring nodes, but this information
would look better in the status line, or not shown at all.

2. Notation for menus: "* Menu:" to start the menu, and lines like the
following for the menu entries:

* Introduction::                An introduction to the shell.

It would look better if "* Menu:" and "::" didn't appear. (In fact, it
would look better with just one column, like this:

* An introduction to the shell

although this would stop anyone typing "mIntroduction" to follow the
menu entry. Also if this is done it should be disabled for the dir
file, because none of the dir entries state the name of the program in
the second column. )

3. Notation for cross-references. For example,

  1. Reads its input from a file (*note Shell Scripts::), from a string
     supplied as an argument to the `-c' invocation option (*note
     Invoking Bash::), or from the user's terminal.

I have attached patches which go some way to removing points 2 and 3
above. They are not complete but I hope they serve as a "proof of
concept".

I have extended the tags table in FILE_BUFFER.tags. Each tag
(representing a node) now has an extra member, NODE.references. (I
merged the TAG and NODE types because they have many of the same
members.) When a node is loaded from the tag table the reference list
is copied over, which contains the list of cross-references and menu
items in the node. This reference list is built when a file (or
sub-file in the case of compound files) is loaded, and the notation
for links is stripped out at the same time. I have output terminal
codes at the same time to make links show up in bold, which works
reasonably well for me although I have noticed a few glitches.
(Storing terminal control sequences in the buffer seems to involve
similar problems to multi-byte characters, i.e. that a sequence of
bytes in the buffer corresponds to less than that number of characters
on the screen, in this case 0.)

Then functions such as info_select_reference_this_line and
info_move_to_xref read this reference list rather than parsing the
file buffer directly. I have only rewritten a few of these - if this
approach is desirable most of session.c will have to be written.

There is a complication with anchor references in the tag tables. If
the length of nodes changes then this becomes incorrect. I have used
NODE.contents in the tag table to point to the real start of the node
contents, and nodestart is only used for seeing what node an anchor is
in.

I can continue work on this but obviously will be more likely to if
there is some enthusiasm for this approach.

The attached patches apply to SVN revision 5405.

Attachment: 01-merge-TAG-and-NODE.patch
Description: Text Data

Attachment: 02-parse-node.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]