Commit ec179403 authored by Glenn Morris's avatar Glenn Morris
Browse files

(top-level): Don't require cl at run-time.

(nnir-run-waissearch, nnir-run-swish-e, nnir-run-hyrex):
Replace cl-function substitute with gnus-replace-in-string.
(nnir-run-waissearch, nnir-run-swish++, nnir-run-swish-e)
(nnir-run-hyrex, nnir-run-namazu): Replace cl-function sort* with sort.
(nnir-run-find-grep): Replace cl-functions find-if and subseq with
simplified expansions.
parent 91677576
2009-08-25 Glenn Morris <rgm@gnu.org>
* nnir.el (top-level): Don't require cl at run-time.
(nnir-run-waissearch, nnir-run-swish-e, nnir-run-hyrex):
Replace cl-function substitute with gnus-replace-in-string.
(nnir-run-waissearch, nnir-run-swish++, nnir-run-swish-e)
(nnir-run-hyrex, nnir-run-namazu): Replace cl-function sort* with sort.
(nnir-run-find-grep): Replace cl-functions find-if and subseq with
simplified expansions.
2009-08-22 Glenn Morris <rgm@gnu.org>
* gnus-art.el (gnus-button-patch): Use forward-line rather than
......
......@@ -336,7 +336,7 @@
(require 'gnus-sum)
(require 'message)
(require 'gnus-util)
(eval-and-compile
(eval-when-compile
(require 'cl))
(nnoo-declare nnir)
......@@ -916,14 +916,15 @@ pairs (also vectors, actually)."
(unless (string-match prefix dirnam)
(nnheader-report 'nnir "Dir name %s doesn't contain prefix %s"
dirnam prefix))
(setq group (substitute ?. ?/ (replace-match "" t t dirnam)))
(setq group (gnus-replace-in-string
(replace-match "" t t dirnam) "/" "."))
(push (vector (nnir-group-full-name group server)
(string-to-number artno)
(string-to-number score))
artlist))
(message "Massaging waissearch output...done")
(apply 'vector
(sort* artlist
(sort artlist
(function (lambda (x y)
(> (nnir-artitem-rsv x)
(nnir-artitem-rsv y)))))))))
......@@ -1235,7 +1236,7 @@ Windows NT 4.0."
;; Sort by score
(apply 'vector
(sort* artlist
(sort artlist
(function (lambda (x y)
(> (nnir-artitem-rsv x)
(nnir-artitem-rsv y)))))))))
......@@ -1316,9 +1317,9 @@ Tested with swish-e-2.0.1 on Windows NT 4.0."
;; eliminate all ".", "/", "\" from beginning. Always matches.
(string-match "^[./\\]*\\(.*\\)$" dirnam)
;; "/" -> "."
(setq group (substitute ?. ?/ (match-string 1 dirnam)))
(setq group (gnus-replace-in-string (match-string 1 dirnam) "/" "."))
;; Windows "\\" -> "."
(setq group (substitute ?. ?\\ group))
(setq group (gnus-replace-in-string group "\\\\" "."))
(push (vector (nnir-group-full-name group server)
(string-to-number artno)
......@@ -1329,7 +1330,7 @@ Tested with swish-e-2.0.1 on Windows NT 4.0."
;; Sort by score
(apply 'vector
(sort* artlist
(sort artlist
(function (lambda (x y)
(> (nnir-artitem-rsv x)
(nnir-artitem-rsv y)))))))))
......@@ -1397,13 +1398,14 @@ Tested with swish-e-2.0.1 on Windows NT 4.0."
score (match-string 3))
(when (string-match prefix dirnam)
(setq dirnam (replace-match "" t t dirnam)))
(push (vector (nnir-group-full-name (substitute ?. ?/ dirnam) server)
(push (vector (nnir-group-full-name
(gnus-replace-in-string dirnam "/" ".") server)
(string-to-number artno)
(string-to-number score))
artlist))
(message "Massaging hyrex-search output...done.")
(apply 'vector
(sort* artlist
(sort artlist
(function (lambda (x y)
(if (string-lessp (nnir-artitem-group x)
(nnir-artitem-group y))
......@@ -1476,7 +1478,7 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
;; sort artlist by score
(apply 'vector
(sort* artlist
(sort artlist
(function (lambda (x y)
(> (nnir-artitem-rsv x)
(nnir-artitem-rsv y)))))))))
......@@ -1505,11 +1507,14 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
"."
;; Try accessing the group literally as well as
;; interpreting dots as directory separators so the
;; engine works with plain nnml as well as the Gnus
;; Cache.
(find-if 'file-directory-p
;; engine works with plain nnml as well as the Gnus Cache.
(let ((group (gnus-group-real-name group)))
(list group (gnus-replace-in-string group "\\." "/" t)))))))
;; Replace cl-func find-if.
(if (file-directory-p group)
group
(if (file-directory-p
(setq group (gnus-replace-in-string group "\\." "/" t)))
group))))))
(unless group
(error "Cannot locate directory for group"))
(save-excursion
......@@ -1532,7 +1537,14 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
(art (string-to-number (car (last path)))))
(while (string= "." (car path))
(setq path (cdr path)))
(let ((group (mapconcat 'identity (subseq path 0 -1) ".")))
(let ((group (mapconcat 'identity
;; Replace cl-func: (subseq path 0 -1)
(let ((end (1- (length path)))
res)
(while (>= (setq end (1- end)) 0)
(push (pop path) res))
(nreverse res))
".")))
(push (vector (nnir-group-full-name group server) art 0)
artlist))
(forward-line 1)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment