8.2 Frames You Can Customize

As mentioned earlier, Supercite uses various frames to perform certain jobs such as mail header information extraction and mail header nuking. However, these frames are not available for you to customize, except through abstract interfaces such as sc-nuke-mail-header, et al.

However, the citation frames Supercite uses provide a lot of customizing power and are thus available to you to change to suit your needs. The workhorse of citation is the frame contained in the variable sc-default-cite-frame. This frame recognizes many situations, such as blank lines, which it interprets as paragraph separators. It also recognizes previously cited nested and non-nested citations in the original message. By default it will coerce non-nested citations into your preferred citation style, and it will add a level of citation to nested citations. It will also simply cite uncited lines in your preferred style.

In a similar vein, there are default frames for unciting and reciting, contained in the variables sc-default-uncite-frame and sc-default-recite-frame respectively.

As mentioned earlier (see Recognizing Citations), citations are recognized through the values of the regular expressions sc-citation-root-regexp, et al. To recognize odd styles, you could modify these variables, or you could modify the default citing frame. Alternatively, you could set up association lists of frames for recognizing specific alternative forms.

For each of the actions—citing, unciting, and reciting—an alist is consulted to find the frame to use (sc-cite-frame-alist, sc-uncite-frame-alist, and sc-recite-frame-alist respectively). These frames can contain alists of the form:

((infokey (regexp . frame) (regexp . frame) …)
 (infokey (regexp . frame) (regexp . frame) …)
 (…))

Where infokey is a key suitable for sc-mail-field, regexp is a regular expression which is string-match’d against the value of the sc-mail-field key, and frame is the frame to use if a match occurred. frame can be a variable containing a frame or a frame in-lined.

When Supercite is about to cite, uncite, or recite a region, it consults the appropriate alist and attempts to find a frame to use. If one is not found from the alist, then the appropriate default frame is used.