Whenever a formula or printer is read from a file or is pasted into
the spreadsheet, it receives a “needs safety check” marking. Later,
when the formula or printer is evaluated for the first time, it is
checked for safety using the
unsafep predicate; if found to be
“possibly unsafe”, the questionable formula or printer is displayed
and you must press Y to approve it or N to use a substitute. The
substitute always signals an error.
Formulas or printers that you type in are checked immediately for safety. If found to be possibly unsafe and you press N to disapprove, the action is canceled and the old formula or printer will remain.
Besides viruses (which try to copy themselves to other files),
unsafep can also detect all other kinds of Trojan horses, such as
spreadsheets that delete files, send email, flood Web sites, alter
your Emacs settings, etc.
Generally, spreadsheet formulas and printers are simple things that don't need to do any fancy computing, so all potentially-dangerous parts of the Emacs Lisp environment can be excluded without cramping your style as a formula-writer. See the documentation in unsafep.el for more info on how Lisp forms are classified as safe or unsafe.