]> git.eshelyaron.com Git - emacs.git/commitdiff
Various fixes and backward compatibility for gnus-search
authorEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 7 Nov 2020 17:40:40 +0000 (09:40 -0800)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 7 Nov 2020 17:44:10 +0000 (09:44 -0800)
* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-read-ephemeral-search-group): Check for and accept the old
nnir-* spec keys.
* lisp/gnus/gnus-search.el (shared-initialize): Use
generate-new-buffer instead of doing it ourselves.
(gnus-search-server-to-engine): Raise an informative error explicitly
if we can't find a search engine, rather than letting it fall through
to something less helpful.
(gnus-search-make-spec): Add `gnus-search--complete-key-data' to
`completion-at-point-functions' locally, not globally.

lisp/gnus/gnus-group.el
lisp/gnus/gnus-search.el

index c6f7e1c41ac4949569373d05bd2ae8feb09cab04..9db0e1897a335d646144e4a8940f3f83e032a182 100644 (file)
@@ -3186,6 +3186,7 @@ non-nil SPECS arg must be an alist with `search-query-spec' and
       (let* ((group-spec
              (or
               (cdr (assq 'search-group-spec specs))
+              (cdr (assq 'nnir-group-spec specs))
               (if (gnus-server-server-name)
                   (list (list (gnus-server-server-name)))
                 (seq-group-by
@@ -3198,6 +3199,7 @@ non-nil SPECS arg must be an alist with `search-query-spec' and
             (query-spec
              (or
               (cdr (assq 'search-query-spec specs))
+              (cdr (assq 'nnir-query-spec specs))
               (gnus-search-make-spec no-parse))))
        (gnus-group-make-group
         name
@@ -3229,6 +3231,7 @@ non-nil SPECS arg must be an alist with `search-query-spec' and
   (interactive "P")
   (let* ((group-spec
          (or (cdr (assq 'search-group-spec specs))
+             (cdr (assq 'nnir-group-spec specs))
              (if (gnus-server-server-name)
                  (list (list (gnus-server-server-name)))
                (seq-group-by
@@ -3240,6 +3243,7 @@ non-nil SPECS arg must be an alist with `search-query-spec' and
                        (assoc (gnus-group-topic-name) gnus-topic-alist))))))))
         (query-spec
          (or (cdr (assq 'search-query-spec specs))
+             (cdr (assq 'nnir-query-spec specs))
              (gnus-search-make-spec no-parse))))
     (gnus-group-read-ephemeral-group
      (concat "nnselect-" (message-unique-id))
index 07bd2bca1bbaa16f2ac6f7ed1803c640bb9de773..abee7c471161bc852734d69d1e36dbd8dbac5979 100644 (file)
@@ -782,8 +782,7 @@ the files in ARTLIST by that search key.")
 (cl-defmethod shared-initialize ((engine gnus-search-process)
                                 slots)
   (setq slots (plist-put slots :proc-buffer
-                        (get-buffer-create
-                         (generate-new-buffer-name " *gnus-search-"))))
+                        (generate-new-buffer " *gnus-search-")))
   (cl-call-next-method engine slots))
 
 (defclass gnus-search-imap (gnus-search-engine)
@@ -1995,7 +1994,7 @@ remaining string, then adds all that to the top-level spec."
               (nnheader-message
                5 "Invalid search engine parameter: (%s %s)"
                key value)))))
-      (nnheader-message 5 "No search engine defined for %s" srv))
+      (error "No search engine defined for %S" method))
     inst))
 
 (declare-function gnus-registry-get-id-key "gnus-registry" (id key))
@@ -2127,7 +2126,8 @@ article came from is also searched."
              (minibuffer-with-setup-hook
                  (lambda ()
                    (add-hook 'completion-at-point-functions
-                             #'gnus-search--complete-key-data))
+                             #'gnus-search--complete-key-data
+                             nil t))
                (read-from-minibuffer
                 "Query: " nil gnus-search-minibuffer-map
                 nil 'gnus-search-history)))