mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-04 08:47:11 +00:00
79d585c2be
Use lexical-binding in all the lisp/obsolete/*.el files. While at it, removed redundant :group arguments and used #' to quote functions. Commented out the key bindings which the #' revealed to lead to non-existing commands, and replaced those revealed to be obsolete. * lisp/obsolete/cl-compat.el: Use cl-lib. * lisp/obsolete/cust-print.el: Assume `defalias` exists. (with-custom-print): Use `declare`. * lisp/obsolete/iswitchb.el (iswitchb-init-XEmacs-trick) (iswitchb-xemacs-backspacekey): Remove functions. * lisp/obsolete/landmark.el (landmark, landmark-nslify-wts): Prefer `apply` to `eval`. * lisp/obsolete/longlines.el (longlines-mode): Don't use `add-to-list` on a hook. * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): Use `clear-string`. * lisp/obsolete/pgg-pgp.el (pgg-pgp-encrypt-region): Remove oddly unused var `passphrase`. (pgg-pgp-verify-region): Declare var `jam-zcat-filename-list`. * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-encrypt-region): Remove oddly unused var `passphrase`. (pgg-pgp5-verify-region): Declare var `jam-zcat-filename-list`. * lisp/obsolete/pgg.el: Remove some XEmacs compatibility code. (pgg-run-at-time, pgg-cancel-timer, pgg-clear-string): Remove functions. Use their core equivalent instead. * lisp/obsolete/rcompile.el (remote-compile): Remove unused vars `l`, `l-host`, `l-user`, and `localname`. * lisp/obsolete/starttls.el (starttls-any-program-available): Use `define-obsolete-function-alias`. * lisp/obsolete/tls.el (tls-format-message): Delete function, use `format-message` instead. * lisp/obsolete/url-ns.el (url-ns-prefs): Use `with-current-buffer` and `dlet`. * lisp/obsolete/vip.el (vip-escape-to-emacs): Remove unused var `key`. (vip-command-argument, vip-read-string, ex-delete, ex-line): Remove unused var `conditions`. (ex-map): Use a closure instead of `eval`. (ex-set): Make it an alias of `set-variable`. (ex-substitute): Remove unused var `cont`. * lisp/obsolete/abbrevlist.el: * lisp/obsolete/bruce.el: * lisp/obsolete/cc-compat.el: * lisp/obsolete/cl-compat.el: * lisp/obsolete/cl.el: * lisp/obsolete/complete.el: * lisp/obsolete/crisp.el: * lisp/obsolete/cust-print.el: * lisp/obsolete/erc-compat.el: * lisp/obsolete/erc-hecomplete.el: * lisp/obsolete/eudcb-ph.el: * lisp/obsolete/fast-lock.el: * lisp/obsolete/gs.el: * lisp/obsolete/gulp.el: * lisp/obsolete/html2text.el: * lisp/obsolete/info-edit.el: * lisp/obsolete/iswitchb.el: * lisp/obsolete/landmark.el: * lisp/obsolete/lazy-lock.el: * lisp/obsolete/longlines.el: * lisp/obsolete/mailpost.el: * lisp/obsolete/mantemp.el: * lisp/obsolete/meese.el: * lisp/obsolete/messcompat.el: * lisp/obsolete/metamail.el: * lisp/obsolete/mouse-sel.el: * lisp/obsolete/nnir.el: * lisp/obsolete/old-emacs-lock.el: * lisp/obsolete/otodo-mode.el: * lisp/obsolete/patcomp.el: * lisp/obsolete/pc-mode.el: * lisp/obsolete/pc-select.el: * lisp/obsolete/pgg-def.el: * lisp/obsolete/pgg-gpg.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/pgg-pgp.el: * lisp/obsolete/pgg-pgp5.el: * lisp/obsolete/pgg.el: * lisp/obsolete/rcompile.el: * lisp/obsolete/s-region.el: * lisp/obsolete/sb-image.el: * lisp/obsolete/sregex.el: * lisp/obsolete/starttls.el: * lisp/obsolete/sup-mouse.el: * lisp/obsolete/terminal.el: * lisp/obsolete/tls.el: * lisp/obsolete/tpu-edt.el: * lisp/obsolete/tpu-extras.el: * lisp/obsolete/tpu-mapper.el: * lisp/obsolete/url-ns.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/vi.el: * lisp/obsolete/vip.el: * lisp/obsolete/ws-mode.el: * lisp/obsolete/yow.el: Use lexical-binding.
39 lines
1.2 KiB
EmacsLisp
39 lines
1.2 KiB
EmacsLisp
;;; meese.el --- protect the impressionable young minds of America -*- lexical-binding: t; -*-
|
|
|
|
;; This is in the public domain on account of being distributed since
|
|
;; 1985 or 1986 without a copyright notice.
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
|
;; Keywords: games
|
|
;; Obsolete-since: 24.4
|
|
|
|
;;; Commentary:
|
|
|
|
;; Adds a hook to protect the impressionable young minds of America
|
|
;; from reading certain files in the Emacs distribution using Emacs.
|
|
|
|
;; This file is named after Ed Meese, the US Attorney General
|
|
;; under President Reagan, because of his support for censorship.
|
|
|
|
;;; Code:
|
|
|
|
(defun protect-innocence-hook ()
|
|
(let ((dir (file-name-directory buffer-file-name)))
|
|
(if (and (equal buffer-file-name (expand-file-name "sex.6" dir))
|
|
(file-exists-p buffer-file-name)
|
|
(not (y-or-n-p "Are you over 18? ")))
|
|
(progn
|
|
(clear-visited-file-modtime)
|
|
(setq buffer-file-name (expand-file-name "celibacy.1" dir))
|
|
(let ((inhibit-read-only t)) ; otherwise (erase-buffer) may bomb.
|
|
(erase-buffer)
|
|
(insert-file-contents buffer-file-name t))
|
|
(rename-buffer (file-name-nondirectory buffer-file-name))))))
|
|
|
|
;;;(add-hook 'find-file-hook 'protect-innocence-hook)
|
|
(provide 'meese)
|
|
|
|
;;; meese.el ends here
|