Function: dictionary-do-matching

dictionary-do-matching is a byte-compiled function defined in dictionary.el.gz.

Signature

(dictionary-do-matching WORD DICTIONARY STRATEGY FUNCTION)

Documentation

Search for WORD with STRATEGY in DICTIONARY and display them with FUNCTION.

Source Code

;; Defined in /usr/src/emacs/lisp/net/dictionary.el.gz
(defun dictionary-do-matching (word dictionary strategy function)
  "Search for WORD with STRATEGY in DICTIONARY and display them with FUNCTION."
  (insert (format-message "Lookup matching words for `%s' in `%s' using `%s'\n"
                          word dictionary strategy))
  (dictionary-send-command
   (concat "match " (dictionary-encode-charset dictionary "") " "
	   (dictionary-encode-charset strategy "") " \""
	   (dictionary-encode-charset word "") "\""))
  (let ((reply (dictionary-read-reply-and-split)))
    (message nil)
    (if (dictionary-check-reply reply 550)
	(error "Dictionary \"%s\" is invalid" dictionary))
    (if (dictionary-check-reply reply 551)
	(error "Strategy \"%s\" is invalid" strategy))
    (if (dictionary-check-reply reply 552)
	(let ((errmsg (format-message
                       (concat
                        "No match for `%s' with strategy `%s' in "
                        "dictionary `%s'.")
                       word strategy dictionary)))
          (insert errmsg "\n")
          (user-error errmsg)))
    (unless (dictionary-check-reply reply 152)
      (error "Unknown server answer: %s" (dictionary-reply reply)))
    (funcall function reply)))