Function: dictionary-match-word

dictionary-match-word is a byte-compiled function defined in dictionary.el.gz.

Signature

(dictionary-match-word WORD &rest _)

Documentation

Return dictionary matches for WORD as a list of strings.

Further arguments are currently ignored.

Source Code

;; Defined in /usr/src/emacs/lisp/net/dictionary.el.gz
(defun dictionary-match-word (word &rest _)
  "Return dictionary matches for WORD as a list of strings.
Further arguments are currently ignored."
  (unless (string-empty-p word)
    (if (string= (car dictionary--last-match) word)
        (cdr dictionary--last-match)
      (dictionary-send-command
       (format "match %s %s \"%s\""
               dictionary-default-dictionary
               dictionary-default-strategy
               word))
      (when (and (= (read (dictionary-read-reply)) 152))
        (with-temp-buffer
          (insert (dictionary-read-answer))
          (goto-char (point-min))
          (let ((result nil))
            (while (not (eobp))
              (search-forward " " nil t)
              (push (read (current-buffer)) result)
              (search-forward "\n" nil t))
            (setq result (reverse result))
            (setq dictionary--last-match (cons word result))
            result))))))