meese.el 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ;;; meese.el --- protect the impressionable young minds of America
  2. ;; This is in the public domain on account of being distributed since
  3. ;; 1985 or 1986 without a copyright notice.
  4. ;; This file is part of GNU Emacs.
  5. ;; Maintainer: FSF
  6. ;; Keywords: games
  7. ;;; Commentary:
  8. ;; Adds a hook to protect the impressionable young minds of America
  9. ;; from reading certain files in the Emacs distribution using Emacs.
  10. ;; This file is named after Ed Meese, the US Attorney General
  11. ;; under President Reagan, because of his support for censorship.
  12. ;;; Code:
  13. (defun protect-innocence-hook ()
  14. (let ((dir (file-name-directory buffer-file-name)))
  15. (if (and (equal buffer-file-name (expand-file-name "sex.6" dir))
  16. (file-exists-p buffer-file-name)
  17. (not (y-or-n-p "Are you over 18? ")))
  18. (progn
  19. (clear-visited-file-modtime)
  20. (setq buffer-file-name (expand-file-name "celibacy.1" dir))
  21. (let ((inhibit-read-only t)) ; otherwise (erase-buffer) may bomb.
  22. (erase-buffer)
  23. (insert-file-contents buffer-file-name t))
  24. (rename-buffer (file-name-nondirectory buffer-file-name))))))
  25. (add-hook 'find-file-hook 'protect-innocence-hook)
  26. (provide 'meese)
  27. ;;; meese.el ends here