bruce.el 6.0 KB

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