comparison lisp/gnus/gnus-gl.el @ 82951:0fde48feb604

Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
author Andreas Schwab <schwab@suse.de>
date Thu, 22 Jul 2004 16:45:51 +0000
parents 695cf19ef79e
children 18a818a2ee7c cce1c0ee76ee
comparison
equal deleted inserted replaced
56503:8bbd2323fbf2 82951:0fde48feb604
1 ;;; gnus-gl.el --- an interface to GroupLens for Gnus 1 ;;; gnus-gl.el --- an interface to GroupLens for Gnus
2 2
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 ;; Free Software Foundation, Inc. 4 ;; Free Software Foundation, Inc.
5 5
6 ;; Author: Brad Miller <bmiller@cs.umn.edu> 6 ;; Author: Brad Miller <bmiller@cs.umn.edu>
7 ;; Keywords: news, score 7 ;; Keywords: news, score
8 8
129 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 129 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
130 ;;;; User variables 130 ;;;; User variables
131 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 131 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
132 132
133 (defvar gnus-summary-grouplens-line-format 133 (defvar gnus-summary-grouplens-line-format
134 "%U\%R\%z%l%I\%(%[%4L: %-20,20n%]%) %s\n" 134 "%U\%R\%z%l%I\%(%[%4L: %-23,23n%]%) %s\n"
135 "*The line format spec in summary GroupLens mode buffers.") 135 "*The line format spec in summary GroupLens mode buffers.")
136 136
137 (defvar grouplens-pseudonym "" 137 (defvar grouplens-pseudonym ""
138 "User's pseudonym. 138 "User's pseudonym.
139 This pseudonym is obtained during the registration process") 139 This pseudonym is obtained during the registration process")
340 ;;;; Get Predictions 340 ;;;; Get Predictions
341 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 341 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
342 342
343 (defun bbb-build-mid-scores-alist (groupname) 343 (defun bbb-build-mid-scores-alist (groupname)
344 "this function can be called as part of the function to return the list of score files to use. 344 "this function can be called as part of the function to return the list of score files to use.
345 See the gnus variable gnus-score-find-score-files-function. 345 See the gnus variable `gnus-score-find-score-files-function'.
346 346
347 *Note:* If you want to use grouplens scores along with calculated scores, 347 *Note:* If you want to use grouplens scores along with calculated scores,
348 you should see the offset and scale variables. At this point, I don't 348 you should see the offset and scale variables. At this point, I don't
349 recommend using both scores and grouplens predictions together." 349 recommend using both scores and grouplens predictions together."
350 (setq grouplens-current-group groupname) 350 (setq grouplens-current-group groupname)
508 (defun bbb-grouplens-other-score (header) 508 (defun bbb-grouplens-other-score (header)
509 (if (not (member grouplens-current-group grouplens-newsgroups)) 509 (if (not (member grouplens-current-group grouplens-newsgroups))
510 ;; Return an empty string 510 ;; Return an empty string
511 "" 511 ""
512 (let* ((rate-string (make-string 12 ?\ )) 512 (let* ((rate-string (make-string 12 ?\ ))
513 (mid (mail-header-id header)) 513 (mid (mail-header-id header))
514 (hashent (gnus-gethash mid grouplens-current-hashtable)) 514 (hashent (gnus-gethash mid grouplens-current-hashtable))
515 (pred (or (nth 0 hashent) 0)) 515 (pred (or (nth 0 hashent) 0))
516 (low (nth 1 hashent)) 516 (low (nth 1 hashent))
517 (high (nth 2 hashent))) 517 (high (nth 2 hashent)))
518 ;; Init rate-string 518 ;; Init rate-string
519 (aset rate-string 0 ?|) 519 (aset rate-string 0 ?|)
520 (aset rate-string 11 ?|) 520 (aset rate-string 11 ?|)
521 (unless (equal grouplens-prediction-display 'prediction-num) 521 (unless (equal grouplens-prediction-display 'prediction-num)
522 (cond ((< pred 0) 522 (cond ((< pred 0)
630 (gnus-message 3 "No BBB connection"))) 630 (gnus-message 3 "No BBB connection")))
631 (setq grouplens-rating-alist nil))) 631 (setq grouplens-rating-alist nil)))
632 632
633 (defun bbb-build-rate-command (rate-alist) 633 (defun bbb-build-rate-command (rate-alist)
634 (concat "putratings " grouplens-bbb-token " " grouplens-current-group " \r\n" 634 (concat "putratings " grouplens-bbb-token " " grouplens-current-group " \r\n"
635 (mapconcat '(lambda (this) ; form (mid . (score . time)) 635 (mapconcat (lambda (this) ; form (mid . (score . time))
636 (concat (car this) 636 (concat (car this)
637 " :rating=" (cadr this) ".00" 637 " :rating=" (cadr this) ".00"
638 " :time=" (cddr this))) 638 " :time=" (cddr this)))
639 rate-alist "\r\n") 639 rate-alist "\r\n")
640 "\r\n.\r\n")) 640 "\r\n.\r\n"))
641 641
642 ;; Interactive rating functions. 642 ;; Interactive rating functions.
643 (defun bbb-summary-rate-article (rating &optional midin) 643 (defun bbb-summary-rate-article (rating &optional midin)
808 (make-local-variable 'gnus-grouplens-mode) 808 (make-local-variable 'gnus-grouplens-mode)
809 (setq gnus-grouplens-mode 809 (setq gnus-grouplens-mode
810 (if (null arg) (not gnus-grouplens-mode) 810 (if (null arg) (not gnus-grouplens-mode)
811 (> (prefix-numeric-value arg) 0))) 811 (> (prefix-numeric-value arg) 0)))
812 (when gnus-grouplens-mode 812 (when gnus-grouplens-mode
813 (make-local-hook 'gnus-select-article-hook) 813 (gnus-make-local-hook 'gnus-select-article-hook)
814 (add-hook 'gnus-select-article-hook 'grouplens-do-time nil 'local) 814 (add-hook 'gnus-select-article-hook 'grouplens-do-time nil 'local)
815 (make-local-hook 'gnus-exit-group-hook) 815 (gnus-make-local-hook 'gnus-exit-group-hook)
816 (add-hook 'gnus-exit-group-hook 'bbb-exit-group nil 'local) 816 (add-hook 'gnus-exit-group-hook 'bbb-exit-group nil 'local)
817 (make-local-variable 'gnus-score-find-score-files-function) 817 (make-local-variable 'gnus-score-find-score-files-function)
818 818
819 (cond 819 (cond
820 ((eq gnus-grouplens-override-scoring 'combine) 820 ((eq gnus-grouplens-override-scoring 'combine)