diff options
| author | Roland McGrath | 1994-01-17 21:44:35 +0000 |
|---|---|---|
| committer | Roland McGrath | 1994-01-17 21:44:35 +0000 |
| commit | b6173caec23a539f3a69c3ce437ba430d1ae0666 (patch) | |
| tree | ad489a4768187e94b78e6a633694f8964b38450a | |
| parent | 18cf95028f3da4d1340d0a0bfbac8febbf56c5f3 (diff) | |
| download | emacs-b6173caec23a539f3a69c3ce437ba430d1ae0666.tar.gz emacs-b6173caec23a539f3a69c3ce437ba430d1ae0666.zip | |
(yow-file): Doc fix.
(yow): With non-nil arg (prefix arg), insert the chosen pinhead wisdom at
point. Use (interactive-p) instead of arg to decide if interactive.
(insert-zippyism): Yow! Am I INSERTED yet?
| -rw-r--r-- | lisp/play/yow.el | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lisp/play/yow.el b/lisp/play/yow.el index d25c6910e69..c3c663bffe5 100644 --- a/lisp/play/yow.el +++ b/lisp/play/yow.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; yow.el --- quote random zippyisms | 1 | ;;; yow.el --- quote random zippyisms |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Maintainer: FSF | 5 | ;; Maintainer: FSF |
| 6 | ;; Keywords: games | 6 | ;; Keywords: games |
| @@ -34,15 +34,17 @@ | |||
| 34 | (require 'cookie1) | 34 | (require 'cookie1) |
| 35 | 35 | ||
| 36 | (defvar yow-file (concat data-directory "yow.lines") | 36 | (defvar yow-file (concat data-directory "yow.lines") |
| 37 | "Pertinent pinhead phrases.") | 37 | "File containing pertinent pinhead phrases.") |
| 38 | 38 | ||
| 39 | ;;;###autoload | 39 | ;;;###autoload |
| 40 | (defun yow (&optional interactive) | 40 | (defun yow (&optional insert) |
| 41 | "Return or display a random Zippy quotation." | 41 | "Return or display a random Zippy quotation. With prefix arg, insert it." |
| 42 | (interactive "p") | 42 | (interactive "P") |
| 43 | (let ((yow (cookie | 43 | (let ((yow (cookie yow-file |
| 44 | yow-file "Am I CONSING yet?..." "I have SEEN the CONSING!!"))) | 44 | "Am I CONSING yet?..." "I have SEEN the CONSING!!"))) |
| 45 | (cond ((not interactive) | 45 | (cond (insert |
| 46 | (insert yow)) | ||
| 47 | ((not (interactive-p)) | ||
| 46 | yow) | 48 | yow) |
| 47 | ((not (string-match "\n" yow)) | 49 | ((not (string-match "\n" yow)) |
| 48 | (delete-windows-on (get-buffer-create "*Help*")) | 50 | (delete-windows-on (get-buffer-create "*Help*")) |
| @@ -58,6 +60,12 @@ If optional second arg is non-nil, require input to match a completion." | |||
| 58 | (read-cookie prompt yow-file | 60 | (read-cookie prompt yow-file |
| 59 | "Am I CONSING yet?..." "I have SEEN the CONSING!!" | 61 | "Am I CONSING yet?..." "I have SEEN the CONSING!!" |
| 60 | require-match)) | 62 | require-match)) |
| 63 | |||
| 64 | ;;;###autoload | ||
| 65 | (defun insert-zippyism (&optional zippyism) | ||
| 66 | "Prompt with completion for a known Zippy quotation, and insert it at point." | ||
| 67 | (interactive (list (read-zippyism "Pinhead wisdom: " t))) | ||
| 68 | (insert zippyism)) | ||
| 61 | 69 | ||
| 62 | ; Yowza!! Feed zippy quotes to the doctor. Watch results. | 70 | ; Yowza!! Feed zippy quotes to the doctor. Watch results. |
| 63 | ; fun, fun, fun. Entertainment for hours... | 71 | ; fun, fun, fun. Entertainment for hours... |