bruce.el 5.9 KB

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