The cursor in a PO file window is almost always part of an entry. The only exceptions are the special case when the cursor is after the last entry in the file, or when the PO file is empty. The entry where the cursor is found to be is said to be the current entry. Many PO mode commands operate on the current entry, so moving the cursor does more than allowing the translator to browse the PO file, this also selects on which entry commands operate.
Some PO mode commands alter the position of the cursor in a specialized way. A few of those special purpose positioning are described here, the others are described in following sections.
Any GNU Emacs command able to reposition the cursor may be used
to select the current entry in PO mode, including commands which
move by characters, lines, paragraphs, screens or pages, and search
commands. However, there is a kind of standard way to display the
current entry in PO mode, which usual GNU Emacs commands moving
the cursor do not especially try to enforce. The command .
(po-current-entry
) has the sole purpose of redisplaying the
current entry properly, after the current entry has been changed by
means external to PO mode, or the Emacs screen otherwise altered.
It is yet to decide if PO mode would help the translator, or otherwise irritate her, by forcing a more fixed window disposition while she is doing her work. We originally had quite precise ideas about how windows should behave, but on the other hand, anyone used to GNU Emacs is often happy to keep full control. Maybe a fixed window disposition might be offered as a PO mode option that the translator might activate or deactivate at will, so it could be offered on an experimental basis. If nobody feels a real need for using it, or a compulsion for writing it, we might as well drop this whole idea. The incentive for doing it should come from translators rather than programmers, as opinions from an experienced translator are surely more worth to me than opinions from programmers thinking about how others should do translation.
The commands n (po-next-entry
) and p
(po-previous-entry
) move the cursor the entry following,
or preceding, the current one. If n is given while the
cursor is on the last entry of the PO file, or if p
is given while the cursor is on the first entry, no move is done.
SPC and DEL are alternate keys for n and
p, respectively.
The commands < (po-first-entry
) and >
(po-last-entry
) move the cursor to the first entry, or last
entry, of the PO file. When the cursor is located past the last
entry in a PO file, most PO mode commands will return an error saying
`After last entry'. However, the commands < and >
have the special property of being able to work even when the cursor
is not into some PO file entry, and you may use them for nicely
correcting this situation. But even these commands will fail on a
truly empty PO file. There are development plans for PO mode for it
to interactively fill an empty PO file from sources. See section Marking Translatable Strings.
The translator may decide, before working at the translation of a particular entry, that she needs browsing the remainder of the PO file, maybe for finding the terminology or phraseology used in related entries. She can of course use the standard Emacs idioms for saving the current cursor location in some register, and use that register for getting back, or else, to use the location ring.
PO mode offers another approach, by which cursor locations may be saved
onto a special stack. The command m (po-push-location
)
merely adds the location of current entry to the stack, pushing
the already saved locations under the new one. The command
l (po-pop-location
) consumes the top stack element and
reposition the cursor to the entry associated with that top element.
This position is then lost, for the next l will move the cursor
to the previously saved location, and so on until locations remain
on the stack.
If the translator wants the position to be kept on the location stack, maybe for taking a mere look at the entry associated with the top element, then go elsewhere with the intent of getting back later, she ought to use m immediately after l.
The command x (po-exchange-location
) simultaneously
reposition the cursor to the entry associated with the top element of
the stack of saved locations, and replace that top element with the
location of the current entry before the move. Consequently, repeating
the x command toggles alternatively between two entries.
For achieving this, the translator will position the cursor on the
first entry, use m, then position to the second entry, and
merely use x for making the switch.
Go to the first, previous, next, last section, table of contents.