Function: dictionary-completing-read-dictionary

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

Signature

(dictionary-completing-read-dictionary)

Documentation

Prompt for a dictionary the server supports.

Probably introduced at or before Emacs version 30.1.

Source Code

;; Defined in /usr/src/emacs/lisp/net/dictionary.el.gz
(defun dictionary-completing-read-dictionary ()
  "Prompt for a dictionary the server supports."
  (let* ((dicts (dictionary-dictionaries))
         (len (apply #'max (mapcar #'length (mapcar #'car dicts)))))
    (completing-read
     (format-prompt "Select dictionary"
                    dictionary-default-dictionary)
     (completion-table-with-metadata
      dicts
      `((annotation-function
         . ,(lambda (key)
              (concat (make-string (1+ (- len (length key))) ?\s)
                      (alist-get key dicts nil nil #'string=))))))
     nil t nil nil dictionary-default-dictionary)))