When Emacs finds a PO file in a window, PO mode is activated for that window. This puts the window read-only and establishes a po-mode-map, which is a genuine Emacs mode, in that way that it is not derived from text mode in any way.
The main PO commands are those who do not fit in the other categories in subsequent sections, they allow for quitting PO mode or managing windows in special ways.
The command u (po-undo
) interfaces to the GNU Emacs
undo facility. See section `Undoing Changes' in The Emacs Editor. Each time u is typed, modifications the translator
did to the PO file are undone a little more. For the purpose of
undoing, each PO mode command is atomic. This is especially true for
the RET command: the whole edition made by using a single
use of this command is undone at once, even if the edition itself
implied several actions. However, while in the editing window, one
can undo the edition work quite parsimoniously.
The command q (po-quit
) is used when the translator is
done with the PO file. If the file has been modified, it is saved
on disk first. However, prior to all this, the command checks if
some untranslated message remains in the PO file and, if yes, the
translator is asked if she really wants to leave working with this
PO file. This is the preferred way of getting rid of an Emacs PO
file buffer. Merely killing it through the usual command C-x
k (kill-buffer
), say, has the unnice effect of leaving a PO
internal work buffer behind.
The command o (po-other-window
) is another, softer
way, to leave PO mode, temporarily. It just moves the cursor in
some other Emacs window, and pops one if necessary. For example, if
the translator just got PO mode to show some source context in some
other, she might discover some apparent bug in the program source
that needs correction. This command allows the translator to change
sex, become a programmer, and have the cursor right into the window
containing the program she (or rather he) wants to modify.
By later getting the cursor back in the PO file window, or by
asking Emacs to edit this file once again, PO mode is then recovered.
The command h (po-help
) displays a summary of all
available PO mode commands. The translator should then type any
character to resume normal PO mode operations. The command ?
has the same effect as h.
The command = (po-statistics
) computes the total number
of entries in the PO file, the ordinal of the current entry
(counted from 1), the number of untranslated entries, the number of
obsolete entries, and displays all these numbers.
The command v (po-validate
) launches msgfmt
in
verbose mode over the current PO file. This command first offers
to save the current PO file on disk. The msgfmt
tool, from
GNU gettext
, has the purpose of creating an MO file out of a
PO file, and PO mode uses the features of this program for checking
the overall format of a PO file, as well as all individual entries.
The program msgfmt
runs asynchronously with Emacs, so
the translator regains control immediately while her PO file
is being studied. Error output is collected in the GNU Emacs
`*compilation*' buffer, displayed in another window. The regular
GNU Emacs command C-x` (next-error
), as well as other
usual compile commands, allow the translator to reposition quickly to
the offending parts of the PO file. Once the cursor on the line in
error, the translator may decide for any PO mode action which would
help correcting the error.
Go to the first, previous, next, last section, table of contents.