1 ;;; zenirc-yow.el --- important pinheadery for ZenIRC
3 ;; Copyright (C) 1994, 1995, 1997 Noah S. Friedman
4 ;; Copyright (C) 1996 Per Persson
6 ;; Author: Noah Friedman <friedman@prep.ai.mit.edu>
7 ;; Maintainer: friedman@prep.ai.mit.edu
8 ;; Keywords: zenirc, extensions, oink, yow
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program; if not, you can either send email to this
23 ;; program's maintainer or write to: The Free Software Foundation,
24 ;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
28 ;; ANN JILLIAN'S HAIR makes LONI ANDERSON'S HAIR look like
29 ;; RICARDO MONTALBAN'S HAIR!
33 (require 'zenirc-trigger)
35 ;; v18 yow.el didn't have a `provide'
36 (or (fboundp 'yow) (load "yow"))
38 ;; Strip newlines and excess whitespace from string.
39 (defun zenirc-yow-format-string (s)
41 (cond ((string-match "[ \t\n\r][ \t\n\r]+" s)
42 (let ((orig-buffer (current-buffer))
43 (temp-buffer (generate-new-buffer " *Yow*")))
46 (set-buffer temp-buffer)
47 ;; don't make undo records in temp buffer
48 (let ((buffer-undo-list t))
50 (goto-char (point-min))
51 (while (re-search-forward "[ \t\n\r]+" nil t)
53 (setq s (buffer-substring (point-min) (point-max)))))
54 (set-buffer orig-buffer)
55 (kill-buffer temp-buffer))))))
59 (zenirc-yow-format-string (yow)))
61 (zenirc-trigger-register "yow" 'zenirc-yow "\\byow\\b")
65 ;;; zenirc-yow.el ends here