Improve skip test if socks server is unavailable
[navi2ch.git] / navi2ch-search.el
blobdfac3e14f9847fcbb881b8fd91d38bc55c0b9e0e
1 ;;; navi2ch-search.el --- Search Module for Navi2ch -*- coding: iso-2022-7bit; -*-
3 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2008, 2009 by Navi2ch
4 ;; Project
6 ;; Author: Taiki SUGAWARA <taiki@users.sourceforge.net>
7 ;; Keywords: 2ch, network
9 ;; This file is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; any later version.
14 ;; This file is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING. If not, write to
21 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
24 ;;; Commentary:
26 ;; namazu(\e$BBg@h@8$N8!:w\e(B) \e$B$r;H$&$K$O\e(B
27 ;; (navi2ch-net-send-request
28 ;; (format "http://64.124.197.202/cgi-bin/search/namazu.cgi?%s"
29 ;; (navi2ch-net-get-param-string
30 ;; '(("query" . "navi2ch")
31 ;; ("submit" . "\e$B8!:w\e(B")
32 ;; ("whence" . "0")
33 ;; ("idxname" . "2chpc")
34 ;; ("max" . "10")
35 ;; ("result" . "normal")
36 ;; ("sort" . "score"))))
37 ;; "GET")
38 ;; \e$B$J46$8$G!#\e(B
43 ;;; Code:
44 (provide 'navi2ch-search)
45 (defconst navi2ch-search-ident
46 "$Id$")
48 (eval-when-compile
49 (require 'cl-lib)
50 (require 'navi2ch-decls)
51 (require 'navi2ch-inline))
52 (require 'navi2ch-vars)
54 (defvar navi2ch-search-mode-map nil)
55 (unless navi2ch-search-mode-map
56 (let ((map (make-sparse-keymap)))
57 (set-keymap-parent map navi2ch-bm-mode-map)
58 (define-key map "Q" 'navi2ch-search-return-previous-board-maybe)
59 (define-key map "s" 'navi2ch-search-sync)
60 (setq navi2ch-search-mode-map map)))
62 (defvar navi2ch-search-mode-menu-spec
63 (navi2ch-bm-make-menu-spec
64 "Search"
65 nil))
67 (defvar navi2ch-search-searched-subject-list nil)
68 (defvar navi2ch-search-board
69 '((name . "\e$B8!:w0lMw\e(B")
70 (type . search)
71 (id . "#search")))
73 (defvar navi2ch-search-history nil)
74 (defvar navi2ch-search-mode-line-info nil)
76 ;;; navi2ch-bm callbacks
77 (defun navi2ch-search-set-property (begin end item)
78 (put-text-property begin end 'item item))
80 (defun navi2ch-search-get-property (point)
81 (get-text-property (save-excursion (goto-char point)
82 (beginning-of-line)
83 (point))
84 'item))
86 (defun navi2ch-search-get-board (item)
87 (car item))
89 (defun navi2ch-search-get-article (item)
90 (cdr item))
92 (defun navi2ch-search-exit ()
93 (run-hooks 'navi2ch-search-exit-hook))
95 ;; regist board
96 (navi2ch-bm-regist-board 'search 'navi2ch-search
97 navi2ch-search-board)
99 ;;; navi2ch-search functions
100 (defun navi2ch-search-insert-subjects ()
101 (let ((i 1))
102 (dolist (x navi2ch-search-searched-subject-list)
103 (let ((article (navi2ch-search-get-article x))
104 (board (navi2ch-search-get-board x)))
105 (navi2ch-bm-insert-subject
107 (cdr (assq 'subject article))
108 ;; \e$B%l%9?t>pJs$,$"$C$?$iI=<(\e(B
109 (if (assq 'response x)
110 (format "(%s) [%s]" (cdr (assq 'response x)) (cdr (assq 'name board)))
111 (format "[%s]" (cdr (assq 'name board)))))
112 (setq i (1+ i))))))
114 (defun navi2ch-search-for-each-board (board-func board-list)
115 (let (alist)
116 (dolist (board board-list)
117 (message "Searching in %s..." (cdr (assq 'name board)))
118 (setq alist (nconc (funcall board-func board)
119 alist)))
120 (message "Searching...%s" (if alist "done" "not found"))
121 (nreverse alist)))
123 (defun navi2ch-search-for-each-article (article-func board-list)
124 (navi2ch-search-for-each-board
125 (lambda (board)
126 (let ((default-directory (navi2ch-board-get-file-name board "")))
127 (delq nil
128 (mapcar (lambda (file)
129 (funcall article-func board file))
130 (and default-directory
131 (file-directory-p default-directory)
132 (sort (directory-files default-directory
133 nil navi2ch-article-local-dat-regexp)
134 #'navi2ch-right-aligned-string<))))))
135 board-list))
137 (defun navi2ch-search-board-subject-regexp (board-list regexp)
138 (navi2ch-search-for-each-board
139 (lambda (board)
140 (let* ((file (navi2ch-board-get-file-name board))
141 (subject-list (and file
142 (navi2ch-board-get-subject-list file)))
143 alist)
144 (dolist (article subject-list)
145 (let ((subject (cdr (assq 'subject article))))
146 (when (string-match regexp subject)
147 (push (cons board article) alist))))
148 alist))
149 board-list))
151 (defun navi2ch-search-article-regexp (board-list regexp)
152 (navi2ch-search-for-each-article
153 (lambda (board file)
154 (with-temp-buffer
155 (navi2ch-board-insert-file-contents board file)
156 (navi2ch-apply-filters board navi2ch-article-filter-list)
157 (goto-char (point-min))
158 (when (re-search-forward regexp nil t)
159 (let ((subject
160 (cdr (assq 'subject
161 (navi2ch-article-get-first-message)))))
162 (list board
163 (cons 'subject subject)
164 (cons 'artid
165 (navi2ch-article-file-name-to-artid file)))))))
166 board-list))
168 (defun navi2ch-search-cache (board-list)
169 (navi2ch-search-for-each-article
170 (lambda (board file)
171 (let ((subject (assq 'subject
172 (navi2ch-article-get-first-message-from-file
173 file board))))
174 (list board subject
175 (cons 'artid (navi2ch-article-file-name-to-artid file)))))
176 board-list))
178 (defun navi2ch-search-orphan (board-list)
179 (navi2ch-search-for-each-article
180 (lambda (board file)
181 (let ((article (list (cons 'artid (navi2ch-article-file-name-to-artid file)))))
182 (if (navi2ch-article-orphan-p board article)
183 (let ((subject (assq 'subject
184 (navi2ch-article-get-first-message-from-file
185 file board))))
186 (nconc (list board subject)
187 article)))))
188 board-list))
190 (easy-menu-define navi2ch-search-mode-menu
191 navi2ch-search-mode-map
192 "Menu used in navi2ch-search"
193 navi2ch-search-mode-menu-spec)
195 (defun navi2ch-search-setup-menu ()
196 (easy-menu-add navi2ch-search-mode-menu))
198 (defun navi2ch-search-mode ()
199 "\\{navi2ch-search-mode-map}"
200 (interactive)
201 (kill-all-local-variables)
202 (setq major-mode 'navi2ch-search-mode)
203 (setq mode-name "Navi2ch Search")
204 (setq buffer-read-only t)
205 (buffer-disable-undo)
206 (use-local-map navi2ch-search-mode-map)
207 (setq navi2ch-mode-line-identification
208 'navi2ch-search-mode-line-info)
209 (navi2ch-set-mode-line-identification)
210 (navi2ch-search-setup-menu)
211 (run-hooks 'navi2ch-bm-mode-hook 'navi2ch-search-mode-hook))
213 (defun navi2ch-search (&rest args)
214 (navi2ch-search-mode)
215 (navi2ch-bm-setup 'navi2ch-search)
216 (navi2ch-search-sync))
218 (defun navi2ch-search-sync ()
219 (interactive)
220 (let ((buffer-read-only nil))
221 (erase-buffer)
222 (save-excursion
223 (navi2ch-search-insert-subjects))))
225 (defun navi2ch-search-return-previous-board-maybe ()
226 (interactive)
227 (if navi2ch-board-current-board
228 (navi2ch-board-select-board ; \e$B1x$M$'!&!&!&\e(B
229 (prog1
230 navi2ch-board-current-board
231 (setq navi2ch-board-current-board nil)))
232 (navi2ch-bm-exit)))
234 (defun navi2ch-search-subject-subr (board-list-or-function)
235 (let ((regexp (navi2ch-read-string "Subject regexp: " nil
236 'navi2ch-search-history))
237 (board-list (if (functionp board-list-or-function)
238 (funcall board-list-or-function)
239 board-list-or-function)))
240 (setq navi2ch-search-searched-subject-list
241 (navi2ch-search-board-subject-regexp board-list regexp)
242 navi2ch-search-mode-line-info
243 (format "Search subject %s" regexp)))
244 (navi2ch-bm-select-board navi2ch-search-board))
246 (defun navi2ch-search-for-each-directory-recursive (function directory)
247 (let ((default-directory directory))
248 (dolist (file (directory-files "."))
249 (if (and (file-directory-p file)
250 (not (member file '("." ".."))))
251 (navi2ch-search-for-each-directory-recursive
252 function (expand-file-name file)))))
253 (funcall function directory))
255 (defun navi2ch-search-directory-to-board (directory directory-to-board-alist)
256 (let ((dir (file-name-as-directory (expand-file-name directory))))
257 (or (cdr (assoc dir directory-to-board-alist))
258 (navi2ch-board-url-to-board
259 (concat "http://"
260 (file-relative-name dir navi2ch-directory))))))
262 (defun navi2ch-search-all-board-list ()
263 (let ((directory-to-board-alist
264 (mapcar (lambda (board)
265 (cons (navi2ch-board-get-file-name board "")
266 board))
267 (navi2ch-list-get-board-name-list
268 (navi2ch-list-get-normal-category-list
269 navi2ch-list-category-list))))
271 (navi2ch-search-for-each-directory-recursive
272 (lambda (directory)
273 (if (file-exists-p (expand-file-name navi2ch-article-summary-file-name
274 directory))
275 (push (navi2ch-search-directory-to-board directory
276 directory-to-board-alist)
277 l)))
278 navi2ch-directory)
279 (nreverse l)))
281 (defun navi2ch-search-all-subject ()
282 (interactive)
283 (navi2ch-search-subject-subr #'navi2ch-search-all-board-list))
285 (defun navi2ch-search-article-subr (board-list-or-function)
286 (let ((regexp (navi2ch-read-string "Search regexp: " nil
287 'navi2ch-search-history))
288 (board-list (if (functionp board-list-or-function)
289 (funcall board-list-or-function)
290 board-list-or-function)))
291 (setq navi2ch-search-searched-subject-list
292 (navi2ch-search-article-regexp board-list regexp)
293 navi2ch-search-mode-line-info
294 (format "Search article %s" regexp)))
295 (navi2ch-bm-select-board navi2ch-search-board))
297 (defun navi2ch-search-all-article ()
298 (interactive)
299 (navi2ch-search-article-subr #'navi2ch-search-all-board-list))
301 (defun navi2ch-search-cache-subr (board-list)
302 (setq navi2ch-search-searched-subject-list
303 (navi2ch-search-cache board-list)
304 navi2ch-search-mode-line-info "Search cache")
305 (navi2ch-bm-select-board navi2ch-search-board))
307 (defun navi2ch-search-all-cache ()
308 (interactive)
309 (navi2ch-search-cache-subr (navi2ch-search-all-board-list)))
311 (defun navi2ch-search-orphan-subr (board-list)
312 (setq navi2ch-search-searched-subject-list
313 (navi2ch-search-orphan board-list)
314 navi2ch-search-mode-line-info "Search orphan")
315 (navi2ch-bm-select-board navi2ch-search-board))
317 (defun navi2ch-search-all-orphan ()
318 (interactive)
319 (navi2ch-search-orphan-subr (navi2ch-search-all-board-list)))
322 (defun navi2ch-search-set-mode-line (&optional str)
324 (setq navi2ch-mode-line-identification str)
325 (navi2ch-set-mode-line-identification))
327 ;;; navi2ch web subject search
328 (defvar navi2ch-search-web-last-search-word nil
329 "\e$B:G8e$K8!:w$7$?J8;zNs\e(B")
330 (defvar navi2ch-search-web-current-start 0
331 "\e$B8=:_!"I=<($7$F$$$k%9%l$N%*%U%;%C%H\e(B")
332 (defvar navi2ch-search-web-current-end 0)
333 (defvar navi2ch-search-web-total-hit 0
334 "\e$B8!:wAm%R%C%H?t\e(B")
335 (defvar navi2ch-search-web-search-method 'navi2ch-search-find-2ch-method)
336 (defsubst navi2ch-search-web-method ()
337 (if (symbolp navi2ch-search-web-search-method)
338 (symbol-value navi2ch-search-web-search-method)
339 navi2ch-search-web-search-method))
340 (defsubst navi2ch-search-web-subject-list (keyword arg)
341 (funcall (nth 0 (navi2ch-search-web-method)) keyword arg))
342 (defun navi2ch-search-web-next (&optional args)
343 (interactive "P")
344 (let ((item (nth 1 (navi2ch-search-web-method))))
345 (navi2ch-search-web
346 (if (functionp item)
347 (apply item args)
348 item))))
349 (defun navi2ch-search-web-previous (&optional args)
350 (interactive "P")
351 (let ((item (nth 2 (navi2ch-search-web-method))))
352 (navi2ch-search-web
353 (if (functionp item)
354 (apply item args)
355 item))))
357 (defun navi2ch-search-web (&optional arg)
358 "web \e$B$N8!:w%7%9%F%`$r;H$C$F\e(B 2ch \e$B$r%9%l%?%$$G8!:w$9$k!#\e(B
359 `arg' \e$B$O\e(B backend \e$B$K$h$j2r<a$,0[$J$k$,!"\e(B `arg' \e$B$,\e(B `nil' \e$B$N>l9g$OI,\e(B
360 \e$B$:?7$7$$8!:w$r3+;O$9$k!#\e(B"
361 (interactive "P")
362 (let (keyword)
363 (if (and navi2ch-search-web-last-search-word arg)
364 (setq keyword navi2ch-search-web-last-search-word)
365 (setq keyword (navi2ch-read-string "Subject search from web: "
367 'navi2ch-search-history)))
368 (setq navi2ch-search-web-last-search-word keyword
369 navi2ch-search-web-current-start 0
370 navi2ch-search-web-current-end 0
371 navi2ch-search-web-total-hit 0)
372 ;; board mode \e$B$KEO$9%9%l%?%$$N%j%9%H:n@.\e(B
373 (setq navi2ch-search-searched-subject-list
374 (navi2ch-search-web-subject-list keyword arg))
375 (navi2ch-bm-select-board navi2ch-search-board)
376 (setq navi2ch-search-mode-line-info
377 (format "Search: %s [%d-%d/%d]"
378 navi2ch-search-web-last-search-word
379 navi2ch-search-web-current-start
380 navi2ch-search-web-current-end
381 navi2ch-search-web-total-hit))))
383 (defun navi2ch-search-web-make-list (url title num)
384 "((board) (subject)) \e$B$N$h$&$J\e(B navi2ch \e$BFbIt$N%9%l>pJs$r5<;wE*$K:n@.!#\e(B"
385 (when (string-match
386 "\\(http://[-a-zA-Z0-9_.!~*';/?:@&=+$,%#]+/\\)test/read.cgi/\\(.+\\)/\\([0-9]+\\)/.*"
387 url)
388 (let ((subject (cons 'subject title))
389 (response (cons 'response num))
390 (artid (cons 'artid (match-string 3 url))))
391 (list (navi2ch-board-url-to-board url) subject artid response))))
393 ;;; navi2ch find.2ch.net
394 (defvar navi2ch-search-find-2ch-method
395 '(navi2ch-search-find-2ch-subject-list
396 navi2ch-search-find-2ch-next
397 navi2ch-search-find-2ch-previous))
398 (defvar navi2ch-search-find-2ch-last-search-num nil)
399 (defvar navi2ch-search-find-2ch-search-num 30
400 "\e$B0lEY$KI=<($9$k8!:w7k2L\e(B
401 find.2ch.net \e$B$N;EMM>e!":GBg$O\e(B50\e$B7o\e(B")
402 (defvar navi2ch-search-find-2ch-coding 'euc-japan-dos
403 "find.2ch.net \e$B$G;H$o$l$k%3!<%G%#%s%0\e(B")
404 (defconst navi2ch-search-find-2ch-thread-regexp
405 "<dt><a href=\"\\(http://[-a-zA-Z0-9_.!~*';/?:@&=+$,%#]+\\)\">\\(.*\\)</a> (\\([0-9]+\\)) - <font size=[-0-9]+><a href=.+/>\\(.+\\)\e$BHD\e(B</a>.+</font></dt><dd>"
406 "find.2ch.net \e$B$G8!:w$9$k\e(B regexp")
408 (defun navi2ch-search-find-2ch-subject-list (query offset)
409 "find.2ch.net \e$B$KJ8;zNs\e(B `query' \e$B$G%j%/%(%9%H!#\e(B
410 `offset' \e$B$O!V<!$N\e(B10\e$B7o!W$H$+I=<($5$;$?$$$H$-$K;H$&!#\e(B"
411 (setq offset
412 (if offset
413 (+ (or navi2ch-search-find-2ch-last-search-num 0) offset)
415 (setq navi2ch-search-find-2ch-last-search-num offset)
416 (let* ((query (navi2ch-url-encode-string query
417 navi2ch-search-find-2ch-coding t))
418 ;; \e$B0UL#$bJ,$+$i$:;H$C$F$k%Q%i%a!<%?B?$7!#FbIt;EMM$,J,$+$j<!Bh2~A1M=Dj\e(B
419 (url (format
420 "http://find.2ch.net/?STR=%s&SCEND=A&SORT=MODIFIED&COUNT=%s&TYPE=TITLE&BBS=ALL&OFFSET=%s"
421 query navi2ch-search-find-2ch-search-num offset))
422 (proc (navi2ch-net-download-file url))
423 (cont (decode-coding-string (navi2ch-net-get-content proc)
424 navi2ch-search-find-2ch-coding))
425 subject-list)
426 (with-temp-buffer
427 (insert cont)
428 (goto-char (point-min))
429 ;; \e$B$^$:Am%R%C%H7o?t$rC5$9\e(B
430 (if (re-search-forward "<font color=white size=-1>\\([0-9]+\\)\e$B%9%lCf\e(B.*\e$BIC\e(B</font>" nil t)
431 (progn
432 (setq navi2ch-search-web-total-hit (string-to-number (match-string 1)))
433 (while (re-search-forward
434 navi2ch-search-find-2ch-thread-regexp
435 nil t)
436 (let ((url (match-string 1))
437 (title (navi2ch-replace-html-tag (match-string 2)))
438 (num (match-string 3)))
439 (push (navi2ch-search-web-make-list url title num)
440 subject-list))))
441 (setq navi2ch-search-web-total-hit 0)
442 (message "No match")))
443 (setq navi2ch-search-web-current-start
444 (min (1+ navi2ch-search-find-2ch-last-search-num)
445 navi2ch-search-web-total-hit)
446 navi2ch-search-web-current-end
447 (min (+ navi2ch-search-find-2ch-last-search-num
448 (min navi2ch-search-find-2ch-search-num 50))
449 navi2ch-search-web-total-hit))
450 (nreverse subject-list)))
452 ;; \e$B<!$N%Z!<%8\e(B
453 (defun navi2ch-search-find-2ch-next ()
454 (min navi2ch-search-find-2ch-search-num 50))
456 ;; \e$BA0$N%Z!<%8\e(B
457 (defun navi2ch-search-find-2ch-previous ()
458 (- (min navi2ch-search-find-2ch-search-num 50)))
460 ;;; navi2ch h.ula.cc
461 (defvar navi2ch-search-hula-method
462 '(navi2ch-search-hula-subject-list 1 -1))
463 (defvar navi2ch-search-hula-current-page nil)
464 (defvar navi2ch-search-hula-coding 'shift_jis)
465 (defconst navi2ch-search-hula-thread-regexp
466 "<nobr>[^<]+<a href=\"http://same.ula.cc/test/r.so/\\([^/]+\\)/\\([^/]+\\)/\\([0-9]+\\)/\\?guid=ON\" target=\"_blank\">\\([^<]*\\) (\\([0-9]+\\))</a></nobr>")
468 (defun navi2ch-search-hula-subject-list (query arg)
469 "h.ula.cc \e$B$KJ8;zNs\e(B `query' \e$B$G%j%/%(%9%H!#\e(B"
470 (setq navi2ch-search-hula-current-page
471 (if arg
472 (+ navi2ch-search-hula-current-page
473 (if (< arg 0) -1 1))
475 (let* ((query (navi2ch-url-encode-string query
476 navi2ch-search-hula-coding t))
477 (url (format
478 "http://h.ula.cc/dance/?P=%d&kenken=%s"
479 navi2ch-search-hula-current-page query))
480 (proc (navi2ch-net-download-file url))
481 (cont (decode-coding-string (navi2ch-net-get-content proc)
482 navi2ch-search-hula-coding))
483 subject-list)
484 (with-temp-buffer
485 (insert cont)
486 (goto-char (point-min))
487 (if (re-search-forward "<font color=red face=\"Arial\"><b>\\([0-9,]+\\)</b></font>"
488 nil t)
489 (progn
490 (setq navi2ch-search-web-total-hit
491 (string-to-number (navi2ch-replace-string "," ""
492 (match-string 1))))
493 (while (re-search-forward
494 navi2ch-search-hula-thread-regexp
495 nil t)
496 (let ((url (format "http://%s/test/read.cgi/%s/%s/"
497 (match-string 1)
498 (match-string 2)
499 (match-string 3)))
500 (title (navi2ch-replace-html-tag (match-string 4)))
501 (num (match-string 5)))
502 (push (navi2ch-search-web-make-list url title num)
503 subject-list))))
504 (setq navi2ch-search-web-total-hit 0)
505 (message "No match")))
506 (setq navi2ch-search-web-current-start
507 (min (1+ (* (1- navi2ch-search-hula-current-page) 50))
508 navi2ch-search-web-total-hit)
509 navi2ch-search-web-current-end
510 (min (* navi2ch-search-hula-current-page 50)
511 navi2ch-search-web-total-hit))
512 (nreverse subject-list)))
514 ;; navi2ch union
515 (defvar navi2ch-search-union-method
516 '(navi2ch-search-union-subject-list 1 -1))
517 (defvar navi2ch-search-union-method-list
518 '(navi2ch-search-find-2ch-method
519 navi2ch-search-hula-method))
520 (defvar navi2ch-search-union-last-search-num 0)
521 (defvar navi2ch-search-union-prev-num nil)
523 (defun navi2ch-search-union-subject-list (keyword arg)
524 (unless arg
525 (setq navi2ch-search-union-last-search-num 0
526 navi2ch-search-union-prev-num nil))
527 (let ((all 0) (current 0) method-list url-list result)
528 (dolist (m navi2ch-search-union-method-list)
529 (let ((navi2ch-search-web-search-method m))
530 (setq method-list (navi2ch-search-web-subject-list
531 keyword
532 (cond
533 ((eq arg 1)
534 (let ((item (nth 1 (navi2ch-search-web-method))))
535 (if (functionp item)
536 (apply item arg)
537 item)))
538 ((eq arg -1)
539 (let ((item (nth 2 (navi2ch-search-web-method))))
540 (if (functionp item)
541 (apply item arg)
542 item)))
543 (t arg)))))
544 (setq all (+ all navi2ch-search-web-total-hit)
545 current (+ current
546 (- navi2ch-search-web-current-end
547 navi2ch-search-web-current-start)
549 (dolist (l method-list)
550 (let ((url (navi2ch-article-to-url (car l) (cdr l))))
551 (unless (member url url-list)
552 (push url url-list)
553 (push l result)))))
554 (setq navi2ch-search-web-total-hit all)
555 (setq navi2ch-search-web-current-start
556 (if (eq arg -1)
557 (or (cadr navi2ch-search-union-prev-num)
559 (1+ navi2ch-search-union-last-search-num)))
560 (setq navi2ch-search-web-current-end
561 (+ current navi2ch-search-web-current-start -1))
562 (setq navi2ch-search-union-last-search-num
563 navi2ch-search-web-current-end)
564 (setq navi2ch-search-union-prev-num
565 (if (eq arg -1)
566 (or (cdr navi2ch-search-union-prev-num) '(1))
567 (cons navi2ch-search-web-current-start
568 navi2ch-search-union-prev-num)))
569 (nreverse result)))
571 (run-hooks 'navi2ch-search-load-hook)
572 ;;; navi2ch-search.el ends here