Function: gnus-read-group
gnus-read-group is a byte-compiled function defined in gnus.el.gz.
Signature
(gnus-read-group PROMPT &optional DEFAULT)
Documentation
Prompt the user for a group name.
Disallow invalid group names.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/gnus.el.gz
(defun gnus-read-group (prompt &optional default)
"Prompt the user for a group name.
Disallow invalid group names."
(let ((prefix "")
group)
(while (not group)
(when (string-match
gnus-invalid-group-regexp
(setq group (read-string (concat prefix prompt)
(cons (or default "") 0)
'gnus-group-history)))
(let ((match (match-string 0 group)))
;; Might be okay (e.g. for nnimap), so ask the user:
(unless (and (not (string-match "^$\\|:" match))
(message-y-or-n-p
"Proceed and create group anyway? " t
"The group name \"" group "\" contains a forbidden character: \"" match "\".
Usually, it's dangerous to create a group with this name, because it's not
supported by all back ends and servers. On IMAP servers it should work,
though. If you are really sure, you can proceed anyway and create the group.
You may customize the variable `gnus-invalid-group-regexp', which currently is
set to \"" gnus-invalid-group-regexp
"\", if you want to get rid of this query permanently."))
(setq prefix (format "Invalid group name: \"%s\". " group)
group nil)))))
group))