From: Andrew G Cohen Date: Sat, 13 May 2017 07:05:27 +0000 (+0800) Subject: Improve search and select group creation X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ddfd3973057115f96a777ba6e597132a8d38b0ba;p=emacs.git Improve search and select group creation * lisp/gnus/gnus-group.el (gnus-group-make-search-group): Make sure new group is inserted into the group buffer. * lisp/gnus/nnselect.el (nnselect-request-create-group): Improve input of selection function. --- diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 7f4822cc30f..71527aba30a 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -3200,17 +3200,18 @@ mail messages or news articles in files that have numeric names." ;; Temporary to make group creation easier (defun gnus-group-make-search-group (nnir-extra-parms &optional specs) (interactive "P") - (let ((name (read-string "Group name: " nil))) - (gnus-group-make-group - name - (list 'nnselect "nnselect") - nil - (list - (cons 'nnselect-specs - (list - (cons 'nnselect-function 'nnir-run-query) - (cons 'nnselect-args - (nnir-make-specs nnir-extra-parms specs)))))))) + (let ((name (gnus-read-group "Group name: "))) + (with-current-buffer gnus-group-buffer + (gnus-group-make-group + name + (list 'nnselect "nnselect") + nil + (list + (cons 'nnselect-specs + (list + (cons 'nnselect-function 'nnir-run-query) + (cons 'nnselect-args + (nnir-make-specs nnir-extra-parms specs))))))))) (defun gnus-group-read-ephemeral-search-group (nnir-extra-parms &optional specs) "Create an nnselect group based on a search. Prompt for a diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 793775f9e10..132f9dd49dc 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -586,7 +586,7 @@ If this variable is nil, or if the provided function returns nil, (specs (assq 'nnselect-specs args)) (function-spec (or (alist-get 'nnselect-function specs) - (read-from-minibuffer "Function: " nil nil t))) + (intern (completing-read "Function: " obarray #'functionp)))) (args-spec (or (alist-get 'nnselect-args specs) (read-from-minibuffer "Args: " nil nil t nil "nil")))