Next: , Previous: , Up: Top   [Contents][Index]


24 Editing Pictures

If you want to create a picture made out of text characters (for example, a picture of the division of a register into fields, as a comment in a program), use the command edit-picture to enter Picture mode.

In Picture mode, editing is based on the quarter-plane model of text. In this model, the text characters lie studded on an area that stretches infinitely far to the right and downward. The concept of the end of a line does not exist in this model; the most you can say is where the last non-blank character on the line is found.

Of course, Emacs really always considers text as a sequence of characters, and lines really do have ends. But in Picture mode most frequently-used keys are rebound to commands that simulate the quarter-plane model of text. They do this by inserting spaces or by converting tabs to spaces.

Most of the basic editing commands of Emacs are redefined by Picture mode to do essentially the same thing but in a quarter-plane way. In addition, Picture mode defines various keys starting with the C-c prefix to run special picture editing commands.

One of these keys, C-c C-c, is pretty important. Often a picture is part of a larger file that is usually edited in some other major mode. M-x edit-picture records the name of the previous major mode. You can then use the C-c C-c command (picture-mode-exit) to restore that mode. C-c C-c also deletes spaces from the ends of lines, unless you give it a numeric argument.

The commands used in Picture mode all work in other modes (provided the picture library is loaded), but are only bound to keys in Picture mode. Note that the descriptions below talk of moving “one column” and so on, but all the picture mode commands handle numeric arguments as their normal equivalents do.

Turning on Picture mode calls the value of the variable picture-mode-hook as a function, with no arguments, if that value exists and is non-nil.


Next: , Previous: , Up: Top   [Contents][Index]