diff options
| author | Eric Abrahamsen | 2020-10-31 18:30:57 -0700 |
|---|---|---|
| committer | Eric Abrahamsen | 2020-11-03 21:20:17 -0800 |
| commit | 9bcdebd9b7432dbdc826579c9a9ec725bbd70d53 (patch) | |
| tree | e20e2ba855f2c05b078afe5f65bb029476a49b3b | |
| parent | 0328b21d1e44f0b5ec2001e2347743ec69159260 (diff) | |
| download | emacs-9bcdebd9b7432dbdc826579c9a9ec725bbd70d53.tar.gz emacs-9bcdebd9b7432dbdc826579c9a9ec725bbd70d53.zip | |
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'.
| -rw-r--r-- | lisp/gnus/gnus-search.el | 77 |
1 files changed, 1 insertions, 76 deletions
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.") | |||
| 825 | gnus-search-grep) | 825 | gnus-search-grep) |
| 826 | nil) | 826 | nil) |
| 827 | 827 | ||
| 828 | (defclass gnus-search-gmane (gnus-search-engine gnus-search-process) | ||
| 829 | nil) | ||
| 830 | |||
| 831 | ;;; The "indexed" search engine. These are engines that use an | 828 | ;;; The "indexed" search engine. These are engines that use an |
| 832 | ;;; external program, with indexes kept on disk, to search messages | 829 | ;;; external program, with indexes kept on disk, to search messages |
| 833 | ;;; usually kept in some local directory. The three common slots are | 830 | ;;; usually kept in some local directory. The three common slots are |
| @@ -970,8 +967,7 @@ quirks.") | |||
| 970 | (define-obsolete-variable-alias 'nnir-method-default-engines | 967 | (define-obsolete-variable-alias 'nnir-method-default-engines |
| 971 | 'gnus-search-default-engines "28.1") | 968 | 'gnus-search-default-engines "28.1") |
| 972 | 969 | ||
| 973 | (defcustom gnus-search-default-engines '((nnimap gnus-search-imap) | 970 | (defcustom gnus-search-default-engines '((nnimap gnus-search-imap)) |
| 974 | (nntp gnus-search-gmane)) | ||
| 975 | "Alist of default search engines keyed by server method." | 971 | "Alist of default search engines keyed by server method." |
| 976 | :version "26.1" | 972 | :version "26.1" |
| 977 | :group 'gnus-search | 973 | :group 'gnus-search |
| @@ -1921,77 +1917,6 @@ Assume \"size\" key is equal to \"larger\"." | |||
| 1921 | artlist))) | 1917 | artlist))) |
| 1922 | grouplist)))) | 1918 | grouplist)))) |
| 1923 | 1919 | ||
| 1924 | (declare-function mm-url-insert "mm-url" (url &optional follow-refresh)) | ||
| 1925 | (declare-function mm-url-encode-www-form-urlencoded "mm-url" (pairs)) | ||
| 1926 | |||
| 1927 | ;; gmane interface | ||
| 1928 | (cl-defmethod gnus-search-run-search ((engine gnus-search-gmane) | ||
| 1929 | srv query &optional groups) | ||
| 1930 | "Run a search against a gmane back-end server." | ||
| 1931 | (let* ((case-fold-search t) | ||
| 1932 | (groupspec (mapconcat | ||
| 1933 | (lambda (x) | ||
| 1934 | (if (string-match-p "gmane" x) | ||
| 1935 | (format "group:%s" (gnus-group-short-name x)) | ||
| 1936 | (error "Can't search non-gmane groups: %s" x))) | ||
| 1937 | groups " ")) | ||
| 1938 | (buffer (slot-value engine 'proc-buffer)) | ||
| 1939 | (search (concat (gnus-search-make-query-string engine query) | ||
| 1940 | " " | ||
| 1941 | groupspec)) | ||
| 1942 | (gnus-inhibit-demon t) | ||
| 1943 | artlist) | ||
| 1944 | (require 'mm-url) | ||
| 1945 | (with-current-buffer buffer | ||
| 1946 | (erase-buffer) | ||
| 1947 | (mm-url-insert | ||
| 1948 | (concat | ||
| 1949 | "http://search.gmane.org/nov.php" | ||
| 1950 | "?" | ||
| 1951 | (mm-url-encode-www-form-urlencoded | ||
| 1952 | `(("query" . ,search) | ||
| 1953 | ("HITSPERPAGE" . "999"))))) | ||
| 1954 | (set-buffer-multibyte t) | ||
| 1955 | (decode-coding-region (point-min) (point-max) 'utf-8) | ||
| 1956 | (goto-char (point-min)) | ||
| 1957 | (forward-line 1) | ||
| 1958 | (while (not (eobp)) | ||
| 1959 | (unless (or (eolp) (looking-at "\x0d")) | ||
| 1960 | (let ((header (nnheader-parse-nov))) | ||
| 1961 | (let ((xref (mail-header-xref header)) | ||
| 1962 | (xscore (string-to-number (cdr (assoc 'X-Score | ||
| 1963 | (mail-header-extra header)))))) | ||
| 1964 | (when (string-match " \\([^:]+\\)[:/]\\([0-9]+\\)" xref) | ||
| 1965 | (push | ||
| 1966 | (vector | ||
| 1967 | (gnus-group-prefixed-name (match-string 1 xref) srv) | ||
| 1968 | (string-to-number (match-string 2 xref)) xscore) | ||
| 1969 | artlist))))) | ||
| 1970 | (forward-line 1))) | ||
| 1971 | (apply #'vector (nreverse (delete-dups artlist))))) | ||
| 1972 | |||
| 1973 | (cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) | ||
| 1974 | (_expr (head near))) | ||
| 1975 | nil) | ||
| 1976 | |||
| 1977 | ;; Can Gmane handle OR or NOT keywords? | ||
| 1978 | (cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) | ||
| 1979 | (_expr (head or))) | ||
| 1980 | nil) | ||
| 1981 | |||
| 1982 | (cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) | ||
| 1983 | (_expr (head not))) | ||
| 1984 | nil) | ||
| 1985 | |||
| 1986 | (cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) | ||
| 1987 | (expr list)) | ||
| 1988 | "The only keyword value gmane can handle is author, ie from." | ||
| 1989 | (cond | ||
| 1990 | ((memq (car expr) '(from sender author address)) | ||
| 1991 | (format "author:%s" (cdr expr))) | ||
| 1992 | ((eql (car expr) 'body) | ||
| 1993 | (cdr expr)))) | ||
| 1994 | |||
| 1995 | ;;; Util Code: | 1920 | ;;; Util Code: |
| 1996 | 1921 | ||
| 1997 | (defun gnus-search-run-query (specs) | 1922 | (defun gnus-search-run-query (specs) |