home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / emacs-15.0.3 / lisp / meese.el < prev    next >
Lisp/Scheme  |  1990-07-19  |  599b  |  15 lines

  1. (defun protect-innocence-hook ()
  2.   (if (and (equal (file-name-nondirectory buffer-file-name) "sex.6")
  3.        (not (y-or-n-p "Are you over 18? ")))
  4.       (progn
  5.     (clear-visited-file-modtime)
  6.     (setq buffer-file-name (concat (file-name-directory buffer-file-name)
  7.                        "celibacy.1"))
  8.     (let (buffer-read-only)    ; otherwise (erase-buffer) may bomb.
  9.       (erase-buffer)
  10.       (insert-file-contents buffer-file-name t))
  11.     (rename-buffer (file-name-nondirectory buffer-file-name)))))
  12.  
  13. (or (memq 'protect-innocence-hook find-file-hooks)
  14.     (setq find-file-hooks (cons 'protect-innocence-hook find-file-hooks)))
  15.