changeset 14:d2f6c32ff984

Initial revision
author Jim Blandy <jimb@redhat.com>
date Fri, 20 May 1988 21:55:27 +0000
parents a436ea70a0cf
children 72e5cc99eab0
files lisp/play/meese.el
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/play/meese.el	Fri May 20 21:55:27 1988 +0000
@@ -0,0 +1,14 @@
+(defun protect-innocence-hook ()
+  (if (and (equal (file-name-nondirectory buffer-file-name) "sex.6")
+	   (not (y-or-n-p "Are you over 18? ")))
+      (progn
+	(clear-visited-file-modtime)
+	(setq buffer-file-name (concat (file-name-directory buffer-file-name)
+				       "celibacy.1"))
+	(let (buffer-read-only)	; otherwise (erase-buffer) may bomb.
+	  (erase-buffer)
+	  (insert-file-contents buffer-file-name t))
+	(rename-buffer (file-name-nondirectory buffer-file-name)))))
+
+(or (memq 'protect-innocence-hook find-file-hooks)
+    (setq find-file-hooks (cons 'protect-innocence-hook find-file-hooks)))