diff options
author | Katsumi Yamaoka <yamaoka@jpl.org> | 2010-10-06 01:09:32 +0000 |
---|---|---|
committer | Katsumi Yamaoka <yamaoka@jpl.org> | 2010-10-06 01:09:32 +0000 |
commit | 61c47336fea47cfbe6a47728ec8335d69bacff3c (patch) | |
tree | b05d2302c2344bcf7de8bc5f12501ed36bc9e736 /lisp/gnus/gnus-group.el | |
parent | a0ec382af2995fab6c903fcf112eea37caab5945 (diff) | |
download | emacs-61c47336fea47cfbe6a47728ec8335d69bacff3c.tar.gz emacs-61c47336fea47cfbe6a47728ec8335d69bacff3c.tar.bz2 emacs-61c47336fea47cfbe6a47728ec8335d69bacff3c.zip |
Eliminate `remove-if-not' that is a cl function.
gnus-util.el (gnus-remove-if): Allow hash table.
gnus-util.el (gnus-remove-if-not): New function.
gnus-art.el (gnus-mime-view-part-as-type): Replace remove-if-not with gnus-remove-if-not.
gnus-score.el (gnus-summary-score-effect): Replace remove-if-not with gnus-remove-if-not.
gnus-sum.el (gnus-read-move-group-name): Replace remove-if-not with gnus-remove-if-not.
gnus-group.el (gnus-group-completing-read): Regard collection as a hash table if it is not a list.
Diffstat (limited to 'lisp/gnus/gnus-group.el')
-rw-r--r-- | lisp/gnus/gnus-group.el | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index a700b5ee8cf..1833c604893 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2163,23 +2163,33 @@ be permanent." (goto-char start))))) (defun gnus-group-completing-read (&optional prompt collection - require-match initial-input hist def) + require-match initial-input hist + def) "Read a group name with completion. Non-ASCII group names are allowed. 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." - (let* ((collection (or collection (or gnus-active-hashtb [0]))) - (choices (mapcar (lambda (symbol) - (let ((group (symbol-name symbol))) - (if (string-match "[^\000-\177]" group) - (gnus-group-decoded-name group) - group))) - (remove-if-not 'symbolp collection))) - (group - (gnus-completing-read (or prompt "Group") choices - require-match initial-input - (or hist 'gnus-group-history) - def))) +respectively if they are omitted. Regards COLLECTION as a hash table +if it is not a list." + (or collection (setq collection gnus-active-hashtb)) + (let (choices group) + (if (listp collection) + (dolist (symbol collection) + (setq group (symbol-name symbol)) + (push (if (string-match "[^\000-\177]" group) + (gnus-group-decoded-name group) + group) + choices)) + (mapatoms (lambda (symbol) + (setq group (symbol-name symbol)) + (push (if (string-match "[^\000-\177]" group) + (gnus-group-decoded-name group) + group) + choices)) + collection)) + (setq group (gnus-completing-read (or prompt "Group") (nreverse choices) + require-match initial-input + (or hist 'gnus-group-history) + def)) (if (symbol-value (intern-soft group collection)) group (mm-encode-coding-string group (gnus-group-name-charset nil group))))) |