align-region-separate
align-region-separate is a variable defined in `
align.el
'.
Its value is
"^\\s-*[{}]?\\s-*$"
- This variable may be risky if used as a file-local variable.
Documentation:
Select the method by which alignment sections will be separated.
If this is a symbol, that symbol's value will be used.
For the sake of clarification, consider the following example, which
will be referred to in the descriptions below.
int alpha = 1; /* one */
double beta = 2.0;
long gamma; /* ten */
unsigned int delta = 1; /* one */
long double epsilon = 3.0;
long long omega; /* ten */
The possible settings for `align-region-separate' are:
`entire' The entire region being aligned will be considered as a
single alignment section. Assuming that comments were not
being aligned to a particular column, the example would
become:
int alpha = 1; /* one */
double beta = 2.0;
long gamma; /* ten */
unsigned int delta = 1; /* one */
long double epsilon;
long long chi = 10; /* ten */
`group' Each contiguous set of lines where a specific alignment
occurs is considered a section for that alignment rule.
Note that each rule may have any entirely different set
of section divisions than another.
int alpha = 1; /* one */
double beta = 2.0;
long gamma; /* ten */
unsigned int delta = 1; /* one */
long double epsilon;
long long chi = 10; /* ten */
`largest' When contiguous rule sets overlap, the largest section
described will be taken as the alignment section for each
rule touched by that section.
int alpha = 1; /* one */
double beta = 2.0;
long gamma; /* ten */
unsigned int delta = 1; /* one */
long double epsilon;
long long chi = 10; /* ten */
NOTE: This option is not supported yet, due to algorithmic
issues which haven't been satisfactorily resolved. There
are ways to do it, but they're both ugly and resource
consumptive.
regexp A regular expression string which defines the section
divider. If the mode you're in has a consistent divider
between sections, the behavior will be very similar to
`largest', and faster. But if the mode does not use clear
separators (for example, if you collapse your braces onto
the preceding statement in C or Perl), `largest' is
probably the better alternative.
function A function that will be passed the beginning and ending
locations of the region in which to look for the section
separator. At the very beginning of the attempt to align,
both of these parameters will be nil, in which case the
function should return non-nil if it wants each rule to
define its own section, or nil if it wants the largest
section found to be used as the common section for all
rules that occur there.
list A list of markers within the buffer that represent where
the section dividers lie. Be certain to use markers! For
when the aligning begins, the ensuing contract/expanding of
whitespace will throw off any non-marker positions.
This method is intended for use in Lisp programs, and not
by the user.
You can customize this variable.