GNU Emacs
Emacs
Dashboard

42.3 Picture Mode Tabs

Two kinds of tab-like action are provided in Picture mode. Use M-TAB ( picture-tab-search) for context-based tabbing. With no argument, it moves to a point underneath the next “interesting” character that follows whitespace in the previous nonblank line. “Next” here means “appearing at a horizontal position greater than the one point starts out at”. With prefix argument, as in C-u M-TAB, this command moves to the next such interesting character in the current line. M-TAB does not change the text; it only moves point. “Interesting” characters are defined by the variable picture-tab-chars, which should define a set of characters. The syntax for this variable is like the syntax used inside of ‘ […]’ in a regular expression—but without the ‘ [’ and the ‘ ]’. Its default value is "!-~".

TAB itself runs picture-tab, which operates based on the current tab stop settings; it is the Picture mode equivalent of tab-to-tab-stop. Normally it just moves point, but with a numeric argument it clears the text that it moves over.

The context-based and tab-stop-based forms of tabbing are brought together by the command C-c TAB ( picture-set-tab-stops). This command sets the tab stops to the positions which M-TAB would consider significant in the current line. The use of this command, together with TAB, can get the effect of context-based tabbing. But M-TAB is more convenient in the cases where it is sufficient.

It may be convenient to prevent use of actual tab characters in pictures. For example, this prevents C-x TAB from messing up the picture. You can do this by setting the variable indent-tabs-mode to nil.