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))))
         (completion-extra-properties
          (list :annotation-function
                (lambda (key)
                  (concat (make-string (1+ (- len (length key))) ?\s)
                          (alist-get key dicts nil nil #'string=))))))
    (completing-read (format-prompt "Select dictionary"
                                    dictionary-default-dictionary)
                     dicts nil t nil nil dictionary-default-dictionary)))