Homepage: https://www.gnu.org/software/emacs
Author: Eric S. Raymond
Retrieve random phrases from fortune cookie files
Support for random cookie fetches from phrase files, used for such critical applications as confounding the NSA Trunk Trawler. The two entry points are `cookie' and `cookie-insert'. The helper function `cookie-shuffle-vector' may be of interest to programmers. The code expects phrase files to be in one of two formats: * ITS-style LINS format (strings terminated by ASCII 0 characters, leading whitespace ignored). * UNIX fortune file format (quotes terminated by %% on a line by itself). Everything up to the first delimiter is treated as a comment. Other formats could be supported by adding alternates to the regexp `cookie-delimiter'. strfile(1) is the program used to compile the files for fortune(6). In order to achieve total compatibility with strfile(1), cookie files should start with two consecutive delimiters (and no comment). This code derives from Steve Strassmann's 1987 spook.el package, but has been generalized so that it supports multiple simultaneous cookie databases and fortune files. It is intended to be called from other packages such as spook.el.