Function: dictionary-dictionaries

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

Signature

(dictionary-dictionaries)

Documentation

Return the list of dictionaries the server supports.

The elements of the list have the form (NAME . DESCRIPTION), where NAME is the string that identifies the dictionary for the server, and DESCRIPTION is its more detailed description, which usually includes the languages it supports.

Source Code

;; Defined in /usr/src/emacs/lisp/net/dictionary.el.gz
(defun dictionary-dictionaries ()
  "Return the list of dictionaries the server supports.
The elements of the list have the form (NAME . DESCRIPTION),
where NAME is the string that identifies the dictionary for
the server, and DESCRIPTION is its more detailed description,
which usually includes the languages it supports."
  (dictionary-send-command "show db")
  (when (and (= (read (dictionary-read-reply)) 110))
    (with-temp-buffer
      (insert (dictionary-read-answer))
      ;; We query the server using 'raw-text', so decode now to present
      ;; human-readable names to the user.
      (decode-coding-region (point-min) (point-max) 'utf-8)
      (goto-char (point-min))
      (let ((result '(("!" . "First matching dictionary")
                      ("*" . "All dictionaries"))))
        (while (not (eobp))
          (push (cons (buffer-substring
                       (search-forward "\n" nil t)
                       (1- (search-forward " " nil t)))
                      (read (current-buffer)))
                result))
        (reverse result)))))