From: Eric Abrahamsen Date: Sun, 1 Nov 2020 01:30:57 +0000 (-0700) Subject: Remove gmane search engine X-Git-Tag: emacs-28.0.90~5255 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9bcdebd9b7432dbdc826579c9a9ec725bbd70d53;p=emacs.git Remove gmane search engine Remove the gnus-search-gmane class and all associated methods. If search functionality is ever resurrected, then revert this commit. * lisp/gnus/gnus-search.el: Delete code, and remove from default value of `gnus-search-default-engines'. --- diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 3ca81f304a0..81be7c588f3 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -825,9 +825,6 @@ quirks.") gnus-search-grep) nil) -(defclass gnus-search-gmane (gnus-search-engine gnus-search-process) - nil) - ;;; The "indexed" search engine. These are engines that use an ;;; external program, with indexes kept on disk, to search messages ;;; usually kept in some local directory. The three common slots are @@ -970,8 +967,7 @@ quirks.") (define-obsolete-variable-alias 'nnir-method-default-engines 'gnus-search-default-engines "28.1") -(defcustom gnus-search-default-engines '((nnimap gnus-search-imap) - (nntp gnus-search-gmane)) +(defcustom gnus-search-default-engines '((nnimap gnus-search-imap)) "Alist of default search engines keyed by server method." :version "26.1" :group 'gnus-search @@ -1921,77 +1917,6 @@ Assume \"size\" key is equal to \"larger\"." artlist))) grouplist)))) -(declare-function mm-url-insert "mm-url" (url &optional follow-refresh)) -(declare-function mm-url-encode-www-form-urlencoded "mm-url" (pairs)) - -;; gmane interface -(cl-defmethod gnus-search-run-search ((engine gnus-search-gmane) - srv query &optional groups) - "Run a search against a gmane back-end server." - (let* ((case-fold-search t) - (groupspec (mapconcat - (lambda (x) - (if (string-match-p "gmane" x) - (format "group:%s" (gnus-group-short-name x)) - (error "Can't search non-gmane groups: %s" x))) - groups " ")) - (buffer (slot-value engine 'proc-buffer)) - (search (concat (gnus-search-make-query-string engine query) - " " - groupspec)) - (gnus-inhibit-demon t) - artlist) - (require 'mm-url) - (with-current-buffer buffer - (erase-buffer) - (mm-url-insert - (concat - "http://search.gmane.org/nov.php" - "?" - (mm-url-encode-www-form-urlencoded - `(("query" . ,search) - ("HITSPERPAGE" . "999"))))) - (set-buffer-multibyte t) - (decode-coding-region (point-min) (point-max) 'utf-8) - (goto-char (point-min)) - (forward-line 1) - (while (not (eobp)) - (unless (or (eolp) (looking-at "\x0d")) - (let ((header (nnheader-parse-nov))) - (let ((xref (mail-header-xref header)) - (xscore (string-to-number (cdr (assoc 'X-Score - (mail-header-extra header)))))) - (when (string-match " \\([^:]+\\)[:/]\\([0-9]+\\)" xref) - (push - (vector - (gnus-group-prefixed-name (match-string 1 xref) srv) - (string-to-number (match-string 2 xref)) xscore) - artlist))))) - (forward-line 1))) - (apply #'vector (nreverse (delete-dups artlist))))) - -(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) - (_expr (head near))) - nil) - -;; Can Gmane handle OR or NOT keywords? -(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) - (_expr (head or))) - nil) - -(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) - (_expr (head not))) - nil) - -(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) - (expr list)) - "The only keyword value gmane can handle is author, ie from." - (cond - ((memq (car expr) '(from sender author address)) - (format "author:%s" (cdr expr))) - ((eql (car expr) 'body) - (cdr expr)))) - ;;; Util Code: (defun gnus-search-run-query (specs)