]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve search and select group creation
authorAndrew G Cohen <cohen@andy.bu.edu>
Sat, 13 May 2017 07:05:27 +0000 (15:05 +0800)
committerAndrew G Cohen <cohen@andy.bu.edu>
Sat, 13 May 2017 07:05:27 +0000 (15:05 +0800)
* 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.

lisp/gnus/gnus-group.el
lisp/gnus/nnselect.el

index 7f4822cc30f36853660849c3ea0524a490f5d66f..71527aba30a688640f4c9b5a82028874559c5d48 100644 (file)
@@ -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
index 793775f9e10f7aa1b4e01a461e41dbfc398bd8f9..132f9dd49dc4828f6f322d3b5d2596c780277eac 100644 (file)
@@ -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")))