Function: gnus-group-completing-read

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

Signature

(gnus-group-completing-read &optional PROMPT COLLECTION REQUIRE-MATCH INITIAL-INPUT HIST DEF)

Documentation

Read a group name with completion.

The arguments are the same as completing-read except that COLLECTION and HIST default to gnus-active-hashtb and gnus-group-history respectively if they are omitted. Can handle COLLECTION as a list, hash table, or vector.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-group.el.gz
(defun gnus-group-completing-read (&optional prompt collection
					     require-match initial-input hist
					     def)
  "Read a group name with completion.
The arguments are the same as `completing-read' except that
COLLECTION and HIST default to `gnus-active-hashtb' and
`gnus-group-history' respectively if they are omitted.  Can
handle COLLECTION as a list, hash table, or vector."
  ;; This function handles vectors for backwards compatibility.  In
  ;; theory, `collection' will only ever be a list or a hash table.
  (or collection (setq collection gnus-active-hashtb))
  (let* ((choices
	   (cond ((listp collection)
		  collection)
		 ((vectorp collection)
		  (mapatoms #'symbol-name collection))
		 ((hash-table-p collection)
		  (hash-table-keys collection))))
	 (group
	  (gnus-completing-read (or prompt "Group") (reverse choices)
				require-match initial-input
				(or hist 'gnus-group-history)
				def)))
    (string-replace "\n" "" group)))