Go to the first, previous, next, last section, table of contents.

Overloading Details

All the overload functions can be found in the file `sc-oloads.el'. In this file are a number of functions which mimic the default behavior of the yanking functions of the major readers. They are typically defined with the same name as their original counterparts, except that "sc-" is prepended to the name. At the appropriate time, the supercite version will be overloaded onto the original, by way of fset-ing the function cell of the original symbol to the function in the supercite version. In this way, overloading is completely under the control of the individual users, eliminating the need for a system administrator's intervention. Overloading is a general solution to the wider problem of extending the functionality of distribution emacs elisp code, without requiring the editing or patching of the distribution files, something that is often not possible for individual users.

The function sc-overload-functions performs the actual fset modification, though it does it in a slightly intelligent manner. It will first check to see if the function symbol is bound, and if not, will skip attempting to overload that symbol. Also, it will check to see if overloading has already been performed on the symbol, and will not try to re-overload the function. It does this by setting the property sc-overloaded on the symbol after overloading it.

The variable sc-overload-functions contains an association list of original functions to hook-ified version functions. Entries take the form:

(ORIGINAL OVERLOAD)

and include all the known yank/reply functions for the major reader subsystems:

If you encounter a reader package that requires overloading, but that supercite does not currently know about, you will need to write the reply-yanking function which cites the text, to call a hook to do the citing. You should call that hook mail-yank-hooks for consistency and set the default value to the default behavior of the reader. Then add the name of the original function and the overloading function to the sc-overload-functions association list. See section Hints to Reader Authors for more details.


Go to the first, previous, next, last section, table of contents.