Gnus development mailing list
 help / color / mirror / Atom feed
* X-Spook
@ 1996-09-15 15:18 Ralph Schleicher
  0 siblings, 0 replies; only message in thread
From: Ralph Schleicher @ 1996-09-15 15:18 UTC (permalink / raw)


Here's a new feature for Gnus' message mode.  I hope that the guys at
the NSA, BND, etc. appreciate it -- after all, it guarantees their jobs.


(defun rs/spook-string (&optional count)
  "Generate a random string of phrases.  COUNT defaults to 6.
If you are using Gnus' message mode for composing articles, then you can
add the following lines of code to your initialization file (which makes
your messages more attractive for automated keyword scanners):

    (eval-after-load \"message\"
                     '(setq message-required-news-headers
                            (append message-required-news-headers
                                    '((X-Spook . rs/spook-string)))))"
  (interactive "*P")
  (load-library "spook")
  (let ((spook-buf (generate-new-buffer " spook"))
	(spook-string ""))
    (unwind-protect
	(save-excursion
	  (set-buffer spook-buf)
	  (cookie-insert spook-phrases-file
			 (if (null count) 6
			   (abs (prefix-numeric-value count))))
	  (goto-char (point-min))
	  (and (looking-at "[ \t\n]+")
	       (replace-match "" t t))
	  (while (search-forward "\n" nil t)
	    (replace-match " " t t))
	  (goto-char (point-max))
	  (delete-horizontal-space)
	  (setq spook-string (buffer-substring (point-min) (point-max))))
      (kill-buffer spook-buf))
    (and (interactive-p)
	 (insert spook-string))
    spook-string))

-- 
Ralph * http://www.UL.BaWue.DE/~rs/

GNU -- vivat, crescat, floreat!


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-09-15 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-15 15:18 X-Spook Ralph Schleicher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).