1 ;;; yow.el --- quote random zippyisms
3 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
6 ;; Author: Richard Mlynarik
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs 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 ;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to
23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
27 ;; Important pinheadery for GNU Emacs.
29 ;; See cookie1.el for implementation. Note --- the `n' argument of yow
30 ;; from the 18.xx implementation is no longer; we only support *random*
37 (defvar yow-file
(concat data-directory
"yow.lines")
38 "File containing pertinent pinhead phrases.")
41 (defun yow (&optional insert
)
42 "Return or display a random Zippy quotation. With prefix arg, insert it."
44 (let ((yow (cookie yow-file
45 "Am I CONSING yet?..." "I have SEEN the CONSING!!")))
48 ((not (interactive-p))
50 ((not (string-match "\n" yow
))
51 (delete-windows-on (get-buffer-create "*Help*"))
55 (with-output-to-temp-buffer "*Help*"
58 (set-buffer standard-output
)
61 (defsubst read-zippyism
(prompt &optional require-match
)
62 "Read a Zippyism from the minibuffer with completion, prompting with PROMPT.
63 If optional second arg is non-nil, require input to match a completion."
64 (read-cookie prompt yow-file
65 "Am I CONSING yet?..." "I have SEEN the CONSING!!"
69 (defun insert-zippyism (&optional zippyism
)
70 "Prompt with completion for a known Zippy quotation, and insert it at point."
71 (interactive (list (read-zippyism "Pinhead wisdom: " t
)))
74 ; Yowza!! Feed zippy quotes to the doctor. Watch results.
75 ; fun, fun, fun. Entertainment for hours...
77 ; written by Kayvan Aghaiepour
80 (defun psychoanalyze-pinhead ()
81 "Zippy goes to the analyst."
83 (doctor) ; start the psychotherapy
85 (switch-to-buffer "*doctor*")
87 (while (not (input-pending-p))
90 (doctor-ret-or-read 1)
91 (doctor-ret-or-read 1)))