* lisp/progmodes/flymake.el (flymake-start-syntax-check-process): Obey `dir'.
[emacs.git] / lisp / play / bruce.el
blob168d528ecb144ba23223313c079ea1b70a14331c
1 ;;; bruce.el --- bruce phrase utility for overloading the Communications -*- no-byte-compile: t -*-
2 ;;; Decency Act snoops, if any.
4 ;; Copyright (C) 1988, 1993, 1997, 2001-2011 Free Software Foundation, Inc.
6 ;; Maintainer: FSF
7 ;; Keywords: games
8 ;; Created: Jan 1997
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;;; Commentary:
27 ;; This program was written to protest the miss-named "Communications
28 ;; Decency Act of 1996. This Act bans "indecent speech", whatever that is,
29 ;; from the Internet. For more on the CDA, see Richard Stallman's essay on
30 ;; censorship, included in the etc directory of emacs distributions 19.34
31 ;; and up. See also http://www.eff.org/blueribbon.html.
33 ;; For many years, emacs has included a program called Spook. This program
34 ;; adds a series of "keywords" to email just before it goes out. On the
35 ;; theory that the NSA monitors people's email, the keywords would be
36 ;; picked up by the NSA's snoop computers, causing them to waste time
37 ;; reading your meeting schedule notices or other email boring to everyone
38 ;; but you and (you hope) the recipient. See below (I left in the original
39 ;; writeup when I made this conversion), or the emacs documentation at
40 ;; ftp://prep.ai.mit.edu/pub/gnu/emacs-manual*.
42 ;; Bruce is a direct copy of spook, with the word "spook" replaced with
43 ;; the word "bruce". Thanks to "esr", whoever he, she or it may be, this
44 ;; conversion was an extremely easy piece of editing, suitable for a first
45 ;; essay at elisp programming.
47 ;; You may think of the name as having been derived from a certain Monty
48 ;; Python routine. Or from Lenny Bruce, who opposed censorship in his own
49 ;; inimitable way. Bruce does exactly what Spook does: it throws keywords
50 ;; into your email messages or other documents.
52 ;; However, in order to comply with the CDA as interpreted by Richard
53 ;; Stallman (see the essay on censorship), bruce is distributed without a
54 ;; data file from which to select words at random. Sorry about that. I
55 ;; believe the average user will be able to come up with a few words on
56 ;; his or her own. If that is a problem, feel free to ask any American
57 ;; teenager, preferably one who attends a government school. Failing
58 ;; that, you might write to Mr. Clinton or Ms Reno or their successors and
59 ;; ask them for suggestions. Think of it as a public spirited act: the
60 ;; time they spend answering you is time not spent persecuting someone
61 ;; else. However, do ask them to respond by snail mail, where their
62 ;; suggestions would be legal.
64 ;; To build the data file, just start a file called bruce.lines in the etc
65 ;; directory of your emacs distribution. Note that each phrase or word has
66 ;; to be followed by an ascii 0, control-@. See the file spook.lines in
67 ;; the etc directory for an example. In emacs, use c-q c-@ to insert the
68 ;; ascii 0s.
70 ;; Once you have edited up a data file, you have to tell emacs how to find
71 ;; the program bruce. Add the following two lines to your .emacs file. Be
72 ;; sure to uncomment the second line.
74 ;; for bruce mode
75 ;; (autoload 'bruce "bruce" "Use the Bruce program to protest the CDA" t)
77 ;; Shut down emacs and fire it up again. Then "M-x bruce" should put some
78 ;; shocking words in the current buffer.
81 ;; Please note that I am not suggesting that you actually use this program
82 ;; to add "illegal" words to your email, or any other purpose. First, you
83 ;; don't really need a program to do it, and second, it would be illegal
84 ;; for me to suggest or advise that you actually break the law. This
85 ;; program was written as a demonstration only, and as an act of political
86 ;; protest and free expression protected by the First Amendment, or
87 ;; whatever is left of it.
90 ;; We now return to the original writeup for spook:
92 ;; Steve Strassmann <straz@media-lab.media.mit.edu> didn't write the
93 ;; program spook, from which this was adapted, and even if he did, he
94 ;; really didn't mean for you to use it in an anarchistic way.
96 ;; To use this:
97 ;; Just before sending mail, do M-x spook.
98 ;; A number of phrases will be inserted into your buffer, to help
99 ;; give your message that extra bit of attractiveness for automated
100 ;; keyword scanners. Help defeat the NSA trunk trawler!
102 ;;; Code:
104 (require 'cookie1)
106 ; Variables
107 (defgroup bruce nil
108 "Insert phrases selected at random from a file into a buffer."
109 :prefix "bruce-"
110 :group 'games)
112 (defcustom bruce-phrases-file "~/bruce.lines"
113 "Keep your favourite phrases here."
114 :type 'file
115 :group 'bruce)
117 (defcustom bruce-phrase-default-count 15
118 "Default number of phrases to insert."
119 :type 'integer
120 :group 'bruce)
122 ;;;###autoload
123 (defun bruce ()
124 "Adds that special touch of class to your outgoing mail."
125 (interactive)
126 (or (file-exists-p bruce-phrases-file)
127 (error "You need to create %s" bruce-phrases-file))
128 (cookie-insert bruce-phrases-file
129 bruce-phrase-default-count
130 "Checking authorization..."
131 "Checking authorization...Approved"))
133 ;;;###autoload
134 (defun snarf-bruces ()
135 "Return a vector containing the lines from `bruce-phrases-file'."
136 (or (file-exists-p bruce-phrases-file)
137 (error "You need to create %s" bruce-phrases-file))
138 (cookie-snarf bruce-phrases-file
139 "Checking authorization..."
140 "Checking authorization...Approved"))
142 ;; Note: the implementation that used to take up most of this file has been
143 ;; cleaned up, generalized, gratuitously broken by esr, and now resides in
144 ;; cookie1.el.
146 (provide 'bruce)
148 ;;; bruce.el ends here