diff options
| author | Stephen Berman | 2013-06-21 20:37:42 +0200 |
|---|---|---|
| committer | Stephen Berman | 2013-06-21 20:37:42 +0200 |
| commit | 716b665eb3a134a5d1ccefd5d4c735e7e7ef62d5 (patch) | |
| tree | ede9da164267b968f3c05e0340ba12e06b8d3516 /lisp/obsolete | |
| parent | ebc83885b750d46eb290192ae25f6b9a92bdd15f (diff) | |
| parent | cad5d1cb5af7210154814b60825576d14740158f (diff) | |
| download | emacs-716b665eb3a134a5d1ccefd5d4c735e7e7ef62d5.tar.gz emacs-716b665eb3a134a5d1ccefd5d4c735e7e7ef62d5.zip | |
Merge from trunk.
Diffstat (limited to 'lisp/obsolete')
| -rw-r--r-- | lisp/obsolete/yow.el | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/lisp/obsolete/yow.el b/lisp/obsolete/yow.el index 42bb0a0b354..fb826d55866 100644 --- a/lisp/obsolete/yow.el +++ b/lisp/obsolete/yow.el | |||
| @@ -60,7 +60,7 @@ | |||
| 60 | (defsubst read-zippyism (prompt &optional require-match) | 60 | (defsubst read-zippyism (prompt &optional require-match) |
| 61 | "Read a Zippyism from the minibuffer with completion, prompting with PROMPT. | 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." | 62 | If optional second arg is non-nil, require input to match a completion." |
| 63 | (read-cookie prompt yow-file yow-load-message yow-after-load-message | 63 | (cookie-read prompt yow-file yow-load-message yow-after-load-message |
| 64 | require-match)) | 64 | require-match)) |
| 65 | 65 | ||
| 66 | ;;;###autoload | 66 | ;;;###autoload |
| @@ -74,33 +74,7 @@ If optional second arg is non-nil, require input to match a completion." | |||
| 74 | "Return a list of all Zippy quotes matching REGEXP. | 74 | "Return a list of all Zippy quotes matching REGEXP. |
| 75 | If called interactively, display a list of matches." | 75 | If called interactively, display a list of matches." |
| 76 | (interactive "sApropos Zippy (regexp): ") | 76 | (interactive "sApropos Zippy (regexp): ") |
| 77 | ;; Make sure yows are loaded | 77 | (cookie-apropos regexp yow-file (called-interactively-p 'interactive))) |
| 78 | (cookie yow-file yow-load-message yow-after-load-message) | ||
| 79 | (let* ((case-fold-search t) | ||
| 80 | (cookie-table-symbol (intern yow-file cookie-cache)) | ||
| 81 | (string-table (symbol-value cookie-table-symbol)) | ||
| 82 | (matches nil) | ||
| 83 | (len (length string-table)) | ||
| 84 | (i 0)) | ||
| 85 | (save-match-data | ||
| 86 | (while (< i len) | ||
| 87 | (and (string-match regexp (aref string-table i)) | ||
| 88 | (setq matches (cons (aref string-table i) matches))) | ||
| 89 | (setq i (1+ i)))) | ||
| 90 | (and matches | ||
| 91 | (setq matches (sort matches 'string-lessp))) | ||
| 92 | (and (called-interactively-p 'interactive) | ||
| 93 | (cond ((null matches) | ||
| 94 | (message "No matches found.")) | ||
| 95 | (t | ||
| 96 | (let ((l matches)) | ||
| 97 | (with-output-to-temp-buffer "*Zippy Apropos*" | ||
| 98 | (while l | ||
| 99 | (princ (car l)) | ||
| 100 | (setq l (cdr l)) | ||
| 101 | (and l (princ "\n\n"))) | ||
| 102 | (help-print-return-message)))))) | ||
| 103 | matches)) | ||
| 104 | 78 | ||
| 105 | 79 | ||
| 106 | ;; Yowza!! Feed zippy quotes to the doctor. Watch results. | 80 | ;; Yowza!! Feed zippy quotes to the doctor. Watch results. |
| @@ -114,15 +88,7 @@ If called interactively, display a list of matches." | |||
| 114 | (defun psychoanalyze-pinhead () | 88 | (defun psychoanalyze-pinhead () |
| 115 | "Zippy goes to the analyst." | 89 | "Zippy goes to the analyst." |
| 116 | (interactive) | 90 | (interactive) |
| 117 | (doctor) ; start the psychotherapy | 91 | (cookie-doctor yow-file)) |
| 118 | (message "") | ||
| 119 | (switch-to-buffer "*doctor*") | ||
| 120 | (sit-for 0) | ||
| 121 | (while (not (input-pending-p)) | ||
| 122 | (insert (yow)) | ||
| 123 | (sit-for 0) | ||
| 124 | (doctor-ret-or-read 1) | ||
| 125 | (doctor-ret-or-read 1))) | ||
| 126 | 92 | ||
| 127 | (provide 'yow) | 93 | (provide 'yow) |
| 128 | 94 | ||