Function: dictionary-do-search
dictionary-do-search is a byte-compiled function defined in
dictionary.el.gz.
Signature
(dictionary-do-search WORD DICTIONARY FUNCTION &optional NOMATCHING)
Documentation
Search for WORD in DICTIONARY and call FUNCTION for each result.
Optional argument NOMATCHING controls whether to suppress the display of matching words.
Source Code
;; Defined in /usr/src/emacs/lisp/net/dictionary.el.gz
(defun dictionary-do-search (word dictionary function &optional nomatching)
"Search for WORD in DICTIONARY and call FUNCTION for each result.
Optional argument NOMATCHING controls whether to suppress the display
of matching words."
(message "Searching for %s in %s" word dictionary)
(dictionary-send-command (concat "define "
(dictionary-encode-charset dictionary "")
" \""
(dictionary-encode-charset word dictionary)
"\""))
(message nil)
(let ((reply (dictionary-read-reply-and-split)))
(if (dictionary-check-reply reply 552)
(progn
(unless nomatching
(insert "Word not found")
(dictionary-do-matching
word
dictionary
"."
(lambda (reply)
(insert ", maybe you are looking for one of these words\n\n")
(dictionary-display-only-match-result reply)))
(dictionary-post-buffer)))
(if (dictionary-check-reply reply 550)
(error "Dictionary \"%s\" is unknown, please select an existing one"
dictionary)
(unless (dictionary-check-reply reply 150)
(error "Unknown server answer: %s" (dictionary-reply reply)))
(funcall function reply)))))