comparison lisp/gnus/nnir.el @ 111430:b75e6634a171

gnus-int.el, nnimap.el, nnir.el: More improvements to thread-referral. message.el (message-send-mail): Don't insert courtesy messages if the message already has List-Post and List-ID messages. gnus-ems.el (gnus-put-image): Use a blank text as the insertion string to avoid making the From headers syntactically invalid.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 07 Nov 2010 00:22:06 +0000
parents 733acab855e4
children 0aa164743cb3
comparison
equal deleted inserted replaced
111429:249a1455856a 111430:b75e6634a171
39 ;; later) by typing `G G' in the Group buffer. You will then get a 39 ;; later) by typing `G G' in the Group buffer. You will then get a
40 ;; buffer which shows all articles matching the query, sorted by 40 ;; buffer which shows all articles matching the query, sorted by
41 ;; Retrieval Status Value (score). 41 ;; Retrieval Status Value (score).
42 42
43 ;; When looking at the retrieval result (in the Summary buffer) you 43 ;; When looking at the retrieval result (in the Summary buffer) you
44 ;; can type `G T' (aka M-x gnus-summary-nnir-goto-thread RET) on an 44 ;; can type `A W' (aka M-x gnus-warp-article RET) on an article. You
45 ;; article. You will be teleported into the group this article came 45 ;; will be warped into the group this article came from. Typing `A W'
46 ;; from, showing the thread this article is part of. 46 ;; (aka M-x gnus-summary-refer-thread RET) will warp to the group and
47 ;; also show the thread this article is part of.
47 48
48 ;; The Lisp setup may involve setting a few variables and setting up the 49 ;; The Lisp setup may involve setting a few variables and setting up the
49 ;; search engine. You can define the variables in the server definition 50 ;; search engine. You can define the variables in the server definition
50 ;; like this : 51 ;; like this :
51 ;; (setq gnus-secondary-select-methods '( 52 ;; (setq gnus-secondary-select-methods '(
470 (add-to-list 'parms (cons 'unique-id (message-unique-id)) t) 471 (add-to-list 'parms (cons 'unique-id (message-unique-id)) t)
471 (gnus-group-read-ephemeral-group 472 (gnus-group-read-ephemeral-group
472 (concat "nnir:" (prin1-to-string parms)) (list 'nnir srv) t 473 (concat "nnir:" (prin1-to-string parms)) (list 'nnir srv) t
473 (cons (current-buffer) gnus-current-window-configuration) 474 (cons (current-buffer) gnus-current-window-configuration)
474 nil))) 475 nil)))
475
476 ;; Summary mode commands.
477
478 (defun gnus-summary-nnir-goto-thread ()
479 "Only applies to nnir groups. Go to group this article came from
480 and show thread that contains this article."
481 (interactive)
482 (unless (eq 'nnir (car (gnus-find-method-for-group gnus-newsgroup-name)))
483 (error "Can't execute this command unless in nnir group"))
484 (let* ((cur (gnus-summary-article-number))
485 (group (nnir-artlist-artitem-group nnir-artlist cur))
486 (backend-number (nnir-artlist-artitem-number nnir-artlist cur))
487 (id (mail-header-id (gnus-summary-article-header)))
488 (refs (split-string
489 (mail-header-references (gnus-summary-article-header)))))
490 (if (eq (car (gnus-find-method-for-group group)) 'nnimap)
491 (progn
492 (nnimap-possibly-change-group (gnus-group-short-name group) nil)
493 (with-current-buffer (nnimap-buffer)
494 (let* ((cmd
495 (let ((value
496 (format
497 "(OR HEADER REFERENCES %s HEADER Message-Id %s)"
498 id id)))
499 (dolist (refid refs value)
500 (setq value
501 (format
502 "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)"
503 refid refid value)))))
504 (result (nnimap-command "UID SEARCH %s" cmd)))
505 (gnus-summary-read-group-1
506 group t t gnus-summary-buffer nil
507 (and (car result)
508 (delete 0 (mapcar
509 #'string-to-number
510 (cdr (assoc "SEARCH" (cdr result))))))))))
511 (gnus-summary-read-group-1 group t t gnus-summary-buffer
512 nil (list backend-number))
513 (gnus-summary-refer-thread))))
514
515
516 (if (fboundp 'eval-after-load)
517 (eval-after-load "gnus-sum"
518 '(define-key gnus-summary-goto-map
519 "T" 'gnus-summary-nnir-goto-thread))
520 (add-hook 'gnus-summary-mode-hook
521 (function (lambda ()
522 (define-key gnus-summary-goto-map
523 "T" 'gnus-summary-nnir-goto-thread)))))
524
525 476
526 477
527 ;; Gnus backend interface functions. 478 ;; Gnus backend interface functions.
528 479
529 (deffoo nnir-open-server (server &optional definitions) 480 (deffoo nnir-open-server (server &optional definitions)
653 last 604 last
654 (and move-is-internal 605 (and move-is-internal
655 to-newsgroup ; Not respooling 606 to-newsgroup ; Not respooling
656 (gnus-group-real-name to-newsgroup))) ; Is this move internal 607 (gnus-group-real-name to-newsgroup))) ; Is this move internal
657 )) 608 ))
609
610 (deffoo nnir-warp-to-article ()
611 (let* ((cur (gnus-summary-article-number))
612 (gnus-newsgroup-name (nnir-artlist-artitem-group nnir-artlist cur))
613 (backend-number (nnir-artlist-artitem-number nnir-artlist cur)))
614 (gnus-summary-read-group-1 gnus-newsgroup-name t t gnus-summary-buffer
615 nil (list backend-number))))
658 616
659 (nnoo-define-skeleton nnir) 617 (nnoo-define-skeleton nnir)
660 618
661 619
662 (defmacro nnir-add-result (dirnam artno score prefix server artlist) 620 (defmacro nnir-add-result (dirnam artno score prefix server artlist)