1

Emacs/Unix info is a nice structure for documentation, and there are significant info available in this format.

Navigation is done using tree-navigation like up, next-on-same-level a.s.o.

This means that reading a complete "document", like a tutorial, is not possible without being observant on the tree structure and where the "natural next" node is located (up one level, then next, to go from last section to next chapter intro...)

Or is there a function/key that will always take me to the next node to read? I think that would be a pre-order traversal of the tree.

4

4 回答 4

2

The behaviour you describe seems to be exactly the behaviour I get by just using the space bar to move through the info. The docs for info-scroll-up (bound to space) say

Scroll one screenful forward in Info, considering all nodes as one sequence. Once you scroll far enough in a node that its menu appears on the screen but after point, the next scroll moves into its first subnode, unless ‘Info-scroll-prefer-subnodes’ is nil.

When you scroll past the end of a node, that goes to the next node if ‘Info-scroll-prefer-subnodes’ is non-nil and to the first subnode otherwise; if this node has no successor, it moves to the parent node’s successor, and so on. If ‘Info-scroll-prefer-subnodes’ is non-nil and point is inside the menu of a node, it moves to subnode indicated by the following menu item. (That case won’t normally result from this command, but can happen in other ways.)

于 2017-01-12T00:25:17.283 回答
1

There is an interactive Elisp function:

(Info-next-preorder)

(not bound to a key by default) which does:

Go to the next subnode or the next node, or go up a level.
于 2017-01-11T17:31:29.640 回答
1

@TimX provided the answer: use SPC (or DEL, for backwards).

In addition, if you use Icicles then you can do the same thing for just the nodes that match your completion input for g (command Info-goto-node): Move among those nodes in book order.

By default the node completion candidates are in alphabetical order, which is good for easy recognition, but not usually not ideal for cycling. But whenever you use a command that accepts your input with completion, Icicles lets you quickly sort the completion candidates in various ways (using C-,).

And for g in Info one of the possible sort orders is in book order. Just use C-, and choose candidate in book order to change to this order.

You can also get this behavior without changing the sort order using C-,, for the particular case where you want to navigate nodes in book order, and limit them to just the nodes in the rest of the book, i.e., those that follow the current node. For this use case, just provide a negative prefix arg: C-- g. (In this case, the first node candidate is .., which means go up to the parent node.)

(To cycle among the nodes that are completion candidates, just use C-down repeatedly during completion. To visit any particular node out of order during completion, use down to cycle to it in *Completions*, then use C-RET to choose it - or just use C-mouse-2 to choose it in *Completions*.)

于 2017-01-12T17:33:32.903 回答
0

Maybe this question belongs on (emacs)...

Exploring the Emacs menus a little reveals Info->Forward Node which runs Info-forward-node which seems to do exactly what was requested. It is bound to ] by default:

Go forward one node, considering all nodes as forming one sequence.

Analogously Info-backward-node also exists and is bound to [.

I don't know the difference to Info-next-preorder as suggested by Jürgen Hötzel, since the documentation about both functions is limited.

于 2017-01-11T20:44:14.150 回答