Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!iuvax!pur-ee!ea.ecn.purdue.edu!housel From: housel@ea.ecn.purdue.edu (Peter S. Housel) Newsgroups: comp.emacs Subject: Filtering news articles in Gnews Keywords: obscenity gnews talk.bizarre Message-ID: <5251@ea.ecn.purdue.edu> Date: 10 Sep 88 19:50:14 GMT Reply-To: housel@ea.ecn.purdue.edu (Peter S. Housel) Organization: Purdue University Engineering Computer Network Lines: 34 If you use Gnews and are sick of seeing any of several offensive, low-information-content words that people seem to be fond of posting these days, you can use the "article-hook" to filter postings in any way you see fit. In particular: --------cut here-------- ;; the controlling variable. (defvar gnews-purge-obscenity nil "If non-nil, remove obscenities from articles. To remove offensive words from all groups, globally setq to non-nil. To purge only a particular group, set a pre-hook for that group containing \"(pre nil gnews-set 'gnews-purge-obscenity t)\"") ;; the hook function (defun article:hook nil (if gnews-purge-obscenity ; then (progn (setq buffer-read-only nil) (save-excursion (progn (goto-char (article-min)) (replace-regexp "" "" nil))) (setq buffer-read-only t)))) (setq article-hook 'article:hook) --------cut here-------- Insert the above or something similar into your "Site.el" or whatever your "load-Gnews-and-set-up-hooks" file is called. Also, set up a pre-hook as described in the documentation string. I also load a version of replace-regexp which does not print "Mark set" and "Done" (just remove the calls to "(message ...)" from the definition, found in loaddefs.el). -Peter S. Housel- housel@ei.ecn.purdue.edu ...!pur-ee!housel