1 ;;; yow.el --- quote random zippyisms
3 ;; Copyright (C) 1993-1995, 2000-2016 Free Software Foundation, Inc.
5 ;; Maintainer: emacs-devel@gnu.org
6 ;; Author: Richard Mlynarik
8 ;; Obsolete-since: 24.4
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
27 ;; Important pinheadery for GNU Emacs.
28 ;; This file is obsolete. For similar functionality, see
29 ;; fortune.el and cookie1.el.
36 "Quote random zippyisms."
40 (defcustom yow-file
(expand-file-name "yow.lines" data-directory
)
41 "File containing pertinent pinhead phrases."
45 (defconst yow-load-message
"Am I CONSING yet?...")
46 (defconst yow-after-load-message
"I have SEEN the CONSING!!")
49 (defun yow (&optional insert display
)
50 "Return or display a random Zippy quotation. With prefix arg, insert it."
52 (let ((yow (cookie yow-file yow-load-message yow-after-load-message
)))
58 (message "%s" yow
)))))
60 (defsubst read-zippyism
(prompt &optional require-match
)
61 "Read a Zippyism from the minibuffer with completion, prompting with PROMPT.
62 If optional second arg is non-nil, require input to match a completion."
63 (cookie-read prompt yow-file yow-load-message yow-after-load-message
67 (defun insert-zippyism (&optional zippyism
)
68 "Prompt with completion for a known Zippy quotation, and insert it at point."
69 (interactive (list (read-zippyism "Pinhead wisdom: " t
)))
73 (defun apropos-zippy (regexp)
74 "Return a list of all Zippy quotes matching REGEXP.
75 If called interactively, display a list of matches."
76 (interactive "sApropos Zippy (regexp): ")
77 (cookie-apropos regexp yow-file
(called-interactively-p 'interactive
)))
80 ;; Yowza!! Feed zippy quotes to the doctor. Watch results.
81 ;; fun, fun, fun. Entertainment for hours...
83 ;; written by Kayvan Aghaiepour
85 (declare-function doctor-ret-or-read
"doctor" (arg))
88 (defun psychoanalyze-pinhead ()
89 "Zippy goes to the analyst."
91 (cookie-doctor yow-file
))