;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:42:39 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/gnus/gnus-gl.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`gnus-gl.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\207" [require gnus-score gnus] 2)
#@58 *The line format spec in summary GroupLens mode buffers.
(defvar gnus-summary-grouplens-line-format "%U%R%z%l%I%(%[%4L: %-20,20n%]%) %s\n" (#$ . -690))
#@78 User's pseudonym.
This pseudonym is obtained during the registration process
(defvar grouplens-pseudonym "" (#$ . 848))
#@33 Host where the bbbd is running.
(defvar grouplens-bbb-host "grouplens.cs.umn.edu" (#$ . 974))
#@35 Port where the bbbd is listening.
(defvar grouplens-bbb-port 9000 (#$ . 1074))
#@52 *Groups that are part of the GroupLens experiment.
(defvar grouplens-newsgroups '("comp.groupware" "comp.human-factors" "comp.lang.c++" "comp.lang.java" "comp.os.linux.admin" "comp.os.linux.advocacy" "comp.os.linux.announce" "comp.os.linux.answers" "comp.os.linux.development" "comp.os.linux.development.apps" "comp.os.linux.development.system" "comp.os.linux.hardware" "comp.os.linux.help" "comp.os.linux.m68k" "comp.os.linux.misc" "comp.os.linux.networking" "comp.os.linux.setup" "comp.os.linux.x" "mn.general" "rec.arts.movies" "rec.arts.movies.current-films" "rec.food.recipes" "rec.humor") (#$ . -1159))
#@512 valid values are:
      prediction-spot -- an * corresponding to the prediction between 1 and 5,
      confidence-interval -- a numeric confidence interval
      prediction-bar --  |#####     | the longer the bar, the better the article,
      confidence-bar --  |  -----   } the prediction is in the middle of the bar,
      confidence-spot -- )  *       | the spot gets bigger with more confidence,
      prediction-num  --   plain-old numeric value,
      confidence-plus-minus  -- prediction +/i confidence
(defvar grouplens-prediction-display 'prediction-spot (#$ . 1775))
#@332 Offset the prediction by this value.
Setting this variable to -2 would have the following effect on
GroupLens scores:

   1   -->   -2
   2   -->   -1
   3   -->    0
   4   -->    1
   5   -->    2

The reason is that a user might want to do this is to combine
GroupLens predictions with scores calculated by other score methods.
(defvar grouplens-score-offset 0 (#$ . 2360))
#@120 This variable allows the user to magnify the effect of GroupLens scores.
The scale factor is applied after the offset.
(defvar grouplens-score-scale-factor 1 (#$ . 2744))
#@321 Tell GroupLens to override the normal Gnus scoring mechanism.
GroupLens scores can be combined with gnus scores in one of three ways.
'override -- just use grouplens predictions for grouplens groups
'combine  -- combine grouplens scores with gnus scores
'separate -- treat grouplens scores completely separate from gnus
(defvar gnus-grouplens-override-scoring 'override (#$ . 2922))
#@31 Current session token number.
(defvar grouplens-bbb-token nil (#$ . 3311))
#@52 Process Id of current bbbd network stream process.
(defvar grouplens-bbb-process nil (#$ . 3392))
#@42 Buffer associated with the BBBD process.
(defvar grouplens-bbb-buffer nil (#$ . 3496))
#@42 Current set of  message-id rating pairs.
(defvar grouplens-rating-alist nil (#$ . 3589))
#@47 A hashtable to hold predictions from the BBB.
(defvar grouplens-current-hashtable nil (#$ . 3684))
(byte-code "\301B\302\301!\204\f \303\303\207" [current-load-list grouplens-current-group boundp nil] 2)
#@126 Number of seconds to wait for some response from the BBB.
If this times out we give up and assume that something has died...
(defvar bbb-timeout-secs 10 (#$ . 3898))
#@38 Message-ID of the last article read.
(defvar grouplens-previous-article nil (#$ . 4070))
(byte-code "\301B\302B\301\207" [current-load-list bbb-read-point bbb-response-point] 2)
(defalias 'bbb-renew-hash-table #[nil "\301\302\303\"\211\207" [grouplens-current-hashtable make-vector 100 0] 3])
(bbb-renew-hash-table)
(defalias 'bbb-connect-to-bbbd #[(host port) "\204 \304\305\306	\"!\212q\210\307\302!\210\307\310!\210e)\203# \311\312\313\217\210\212q\210\314 \210)\315\316\215\210\207" [grouplens-bbb-buffer host bbb-read-point grouplens-bbb-process gnus-get-buffer-create format " *BBBD trace: %s*" make-local-variable bbb-response-point #1=#:G97322 (byte-code "\301!\302=\203 \303\304\"\210\305!\210\304\207" [grouplens-bbb-process process-status open set-process-buffer nil delete-process] 3) ((error)) erase-buffer done (byte-code "\303\304\305\217\210\204 \306\307\310\"\210\212	q\210e\311!\204 \306\307\310\"\210)\310\207" [grouplens-bbb-process grouplens-bbb-buffer bbb-read-point error (byte-code "\304\305	\n$\304\207" [grouplens-bbb-buffer host port grouplens-bbb-process open-network-stream "BBBD"] 5) ((error (gnus-message 3 "Error: Failed to connect to BBB"))) throw done nil bbb-read-response] 3)] 4])
(defalias 'bbb-send-command #[(process command) "db\210c\210\304c\210``\305!`\306\223\210\307\"\210\307\304\"\210\310!\207" [command bbb-read-point bbb-response-point process "\n" process-mark nil process-send-string process-send-eof] 3])
#@70 This function eats the initial response of OK or ERROR from the BBB.
(defalias 'bbb-read-response #[(process) "\305\211\nb\210\306\307\305\310#\204 \311\f\"\203 \nb\210\202 `\nb\210\312\313!*\207" [match-end case-fold-search bbb-read-point process bbb-timeout-secs nil search-forward "\n" t accept-process-output looking-at "OK"] 4 (#$ . 5565)])
#@71 return the token number if login is successful, otherwise return nil.
(defalias 'bbb-login #[nil "\305	\306\232\2044 \307\n\"\211\2030 \212\310\f!q\210\311\f\312	P\"\210\313\f!\203* \314 \202/ \315\316\317\"\210))\2029 \315\316\320\"\210\207" [grouplens-bbb-token grouplens-pseudonym grouplens-bbb-host grouplens-bbb-port bbb-process nil "" bbb-connect-to-bbbd process-buffer bbb-send-command "login " bbb-read-response bbb-extract-token-number gnus-message 3 "Error: GroupLens login failed" "Error: you must set a pseudonym"] 5 (#$ . 5927) nil])
(defalias 'bbb-extract-token-number #[nil "\301\302\303\304#\305\306!\205 \307\225{)\207" [token-pos search-forward "token=" nil t looking-at "[0-9]+" 0] 4])
(gnus-add-shutdown 'bbb-logout 'gnus)
#@24 logout of bbb session.
(defalias 'bbb-logout #[nil "\205 \304	\n\"\211\205 \212\305!q\210\306\307P\"\210\310!))\207" [grouplens-bbb-token grouplens-bbb-host grouplens-bbb-port bbb-process bbb-connect-to-bbbd process-buffer bbb-send-command "logout " bbb-read-response] 5 (#$ . 6684)])
#@366 this function can be called as part of the function to return the list of score files to use.
See the gnus variable gnus-score-find-score-files-function.

*Note:*  If you want to use grouplens scores along with calculated scores,
you should see the offset and scale variables.  At this point, I don't
recommend using both scores and grouplens predictions together.
(defalias 'bbb-build-mid-scores-alist #[(groupname) "\n\235\205 \304\305\306C\307\310 \"\"CCC\207" [groupname grouplens-current-group grouplens-newsgroups grouplens-previous-article nil append "message-id" bbb-get-predictions bbb-get-all-mids] 5 (#$ . 6984)])
#@60 Ask the bbb for predictions, and build up the score alist.
(defalias 'bbb-get-predictions #[(midlist groupname) "\306\307\310\"\210\2037 \311	\n\"\211\2055 \212\312!q\210\313\314\f#\"\210\315!\203- \316!\2024 \306\317\320\"\210\321 ))\207\306\322\323\"\210\321 \207" [grouplens-bbb-token grouplens-bbb-host grouplens-bbb-port bbb-process midlist groupname gnus-message 5 "Fetching Predictions..." bbb-connect-to-bbbd process-buffer bbb-send-command bbb-build-predict-command bbb-read-response bbb-get-prediction-response 1 "Invalid Token, login and try again" ding 3 "Error: You are not logged in to a BBB"] 7 (#$ . 7621)])
(defalias 'bbb-get-all-mids #[nil "\301\302\"\207" [gnus-newsgroup-headers mapcar #[(x) "\301H\207" [x 4] 2]] 3])
(defalias 'bbb-build-predict-command #[(mlist grpname token) "\303\304	\305\306\307\n\305#\310\260\207" [token grpname mlist "getpredictions " " " "\n" mapconcat identity "\n.\n"] 9])
(defalias 'bbb-get-prediction-response #[(process) "\305	b\210\306\307\305\310#\204 \311\n\"\203 	b\210\202 \f\312\\b\210\313 )\207" [case-fold-search bbb-read-point process bbb-timeout-secs bbb-response-point nil search-forward ".\n" t accept-process-output 4 bbb-build-response-alist] 4])
(defalias 'bbb-build-response-alist #[nil "\304\211\211\305\306!\203 \307y\210\202 \305\310!\2038 \311 \312 	\313BB\nB\314	\"\315 \316 EL\210\307y\210\202 \305\317!\203\\ \311 \312 	\320BB\nB\314	\"\321\211EL\210\307y\210\202 \n+\207" [pred mid resp grouplens-current-hashtable nil looking-at "\\(<.*>\\) :nopred=" 1 "\\(<.*>\\) :pred=\\([0-9].[0-9][0-9]\\) :conflow=\\([0-9].[0-9][0-9]\\) :confhigh=\\([0-9].[0-9][0-9]\\)" bbb-get-mid bbb-get-pred (nil s) intern bbb-get-confl bbb-get-confh "\\(<.*>\\) :pred=\\([0-9].[0-9][0-9]\\)" (nil s) 0] 4])
(defalias 'bbb-get-mid #[nil "\300\224\300\225{\207" [1] 2])
(defalias 'bbb-get-pred #[nil "\303\304\224\304\225{!\211\305V\203 \306	\n\\_!\202 \307)\207" [tpred grouplens-score-scale-factor grouplens-score-offset string-to-number 2 0 round 1] 5])
(defalias 'bbb-get-confl #[nil "\300\301\224\301\225{!\207" [string-to-number 4] 3])
(defalias 'bbb-get-confh #[nil "\300\301\224\301\225{!\207" [string-to-number 4] 3])
(byte-code "\301B\305\302B\306\303B\307\304B\310\311B\301\207" [current-load-list grplens-rating-range grplens-maxrating grplens-minrating grplens-predstringsize 4.0 5 1 12 gnus-tmp-score] 2)
(defalias 'bbb-grouplens-score #[(header) "\306=\203\n \307	!\207\310\311\312\"	\313H\314\f\"J'(A@)AA@*\n\315\316I\210\n\317\316I\210+,\235\204^ -\320\232\204X (\315W\203N \321(\202X (\322V\203X \322(\315)\315*\323(!\203\346 \203\346 -\324\232\203y \325\n(\"\202\360 -\326\232\203\214 \327()*#\202\360 -\330\232\203\234 \331\n(\"\202\360 -\332\232\203\254 \333\334(\"\202\360 -\335\232\203\274 \333\334(\"\202\360 -\320\232\203\313 \336(!\202\360 -\337\232\203\336 \340()*#\202\360 \341\342\343\"\210\202\360 \n\322\344I\210\n\345\346I\210\n.\207" [gnus-grouplens-override-scoring header rate-string mid grouplens-current-hashtable hashent separate bbb-grouplens-other-score make-string 12 32 4 intern-soft 0 124 11 prediction-num 1 5 bbb-valid-score prediction-spot bbb-fmt-prediction-spot confidence-interval bbb-fmt-confidence-interval prediction-bar bbb-fmt-prediction-bar confidence-bar format "|   %4.2f   |" confidence-spot bbb-fmt-prediction-num confidence-plus-minus bbb-fmt-confidence-plus-minus gnus-message 3 "Invalid prediction display type" 78 6 65 gnus-tmp-score iscore low high grouplens-current-group grouplens-newsgroups grouplens-prediction-display] 4])
(defalias 'bbb-grouplens-other-score #[(header) "	\235\204 \306\207\307\310\311\"\312H\313\f\"J\211&@\206 \314'&A@(\315&8)\n\314\316I\210\n\317\316I\210*\320\232\204T '\314W\203J \321'\202T '\322V\203T \322'&\204g \n\322\323I\210\n\324\325I\210\n\202\345 *\326\232\203v \327\n'\"\202\345 *\330\232\203\210 \331'()#\202\345 *\332\232\203\227 \333\n'\"\202\345 *\334\232\203\246 \335\336'\"\202\345 *\337\232\203\265 \335\336'\"\202\345 *\320\232\203\303 \340'!\202\345 *\341\232\203\325 \342'()#\202\345 \343\344\345\"\210\n\314\316I\210\n\317\316I\210\n.\207" [grouplens-current-group grouplens-newsgroups rate-string header mid grouplens-current-hashtable "" make-string 12 32 4 intern-soft 0 2 124 11 prediction-num 1 5 78 6 65 prediction-spot bbb-fmt-prediction-spot confidence-interval bbb-fmt-confidence-interval prediction-bar bbb-fmt-prediction-bar confidence-bar format "|   %4.2f   |" confidence-spot bbb-fmt-prediction-num confidence-plus-minus bbb-fmt-confidence-plus-minus gnus-message 3 "Invalid prediction display type" hashent pred low high grouplens-prediction-display] 5])
(defalias 'bbb-valid-score #[(score) "\304\232\206 	\nY\205 	X\207" [grouplens-prediction-display score grplens-minrating grplens-maxrating prediction-num] 2])
(defalias 'bbb-requires-confidence #[(format-type) "\301\232\206 \302\232\206 \303\232\207" [format-type confidence-plus-minus confidence-spot confidence-interval] 2])
(defalias 'bbb-have-confidence #[(clow chigh) "?\206 	??\207" [clow chigh] 1])
(defalias 'bbb-fmt-prediction-spot #[(rate-string score) "\305	\nZ\245\f\306Z\307\\_!\310I\210\207" [rate-string score grplens-minrating grplens-rating-range grplens-predstringsize round 4 1.49 42] 5])
(defalias 'bbb-fmt-confidence-interval #[(score low high) "\303	\"\203 \304\305	#\207\306\n!\207" [low high score bbb-have-confidence format "|%4.2f-%4.2f |" bbb-fmt-prediction-num] 4])
(defalias 'bbb-fmt-confidence-plus-minus #[(score low high) "\303	\"\203 \304\305\n	Z\306\245#\207\307\n!\207" [low high score bbb-have-confidence format "|%3.1f+/-%4.2f|" 2.0 bbb-fmt-prediction-num] 5])
(defalias 'bbb-fmt-prediction-bar #[(rate-string score) "\306	\n\307Z\245\211\310\245\fZ\n\310ZW\203< \fV\203* \311I\210\2020 \312I\210T\\\202 ,\207" [i grplens-rating-range grplens-predstringsize step half-step grplens-minrating 1 4 2 35 32 loc score rate-string] 4])
(defalias 'bbb-fmt-prediction-num #[(score) "\301\302\"\207" [score format "|   %4.2f   |"] 3])
(defalias 'bbb-put-ratings #[nil "\203R 	\203R \n\235\203R \306\f\"\307	!\211\203L \212\310!q\210\311\312\313\"\210\314\"\210\315!\203< \316\202D \311\317\320\"\210\321 \210\311\312\322\")\202P \311\323\324\"*\207\316\211\207" [grouplens-bbb-token grouplens-rating-alist gnus-newsgroup-name grouplens-newsgroups grouplens-bbb-host grouplens-bbb-port bbb-connect-to-bbbd bbb-build-rate-command process-buffer gnus-message 5 "Sending Ratings..." bbb-send-command bbb-read-response nil 1 "Token timed out: call bbb-login and quit again" ding "Sending Ratings...Done" 3 "No BBB connection" rate-command bbb-process] 4])
(defalias 'bbb-build-rate-command #[(rate-alist) "\303\304	\305\306\307\n\310#\311\260\207" [grouplens-bbb-token grouplens-current-group rate-alist "putratings " " " " \n" mapconcat #[(this) "@\302\211A@)\303\304\211AA)\260\207" [this x " :rating=" ".00" " :time="] 7] "\n" "\n.\n"] 9])
(defalias 'bbb-summary-rate-article #[(rating &optional midin) "	\235\205P \n\206\f \306 \f\203K \fY\203K \fX\203K \203K \307\"\211\2037 \f\310B\241\210\202A \f\310BBB\311\312\313\f!\")\202O \314\315\316\")\207" [gnus-newsgroup-name grouplens-newsgroups midin mid rating grplens-minrating bbb-get-current-id assoc 0 gnus-summary-mark-article nil int-to-string gnus-message 3 "Invalid rating" grplens-maxrating grouplens-rating-alist oldrating] 5 nil "nRating: "])
#@42 Select unread article after current one.
(defalias 'grouplens-next-unread-article #[(rating) "\203 \301!\210\302 \207" [rating bbb-summary-rate-article gnus-summary-next-unread-article] 2 (#$ . 15231) "P"])
#@42 Select unread article after current one.
(defalias 'grouplens-best-unread-article #[(rating) "\203 \301!\210\302 \207" [rating bbb-summary-rate-article gnus-summary-best-unread-article] 2 (#$ . 15447) "P"])
#@146 Mark all articles not marked as unread in this newsgroup as read, then exit.
If prefix argument ALL is non-nil, all articles are marked as read.
(defalias 'grouplens-summary-catchup-and-exit #[(rating) "\203 \301!\210\247\203 \302 \207\302!\207" [rating bbb-summary-rate-article gnus-summary-catchup-and-exit] 2 (#$ . 15664) "P"])
#@67 Raise the score of the articles in the current thread with SCORE.
(defalias 'grouplens-score-thread #[(score) "\306\212\307 \306\n\211A@\211\203$ \310	!\210\311\312	\f\2368\313H\"\210\202 *`)\314\315\316\317\314\"!\2046 b\210*\320 \210\321 \210\322\323!\207" [e article articles score gnus-newsgroup-data gnus-summary-check-current nil gnus-summary-articles-in-thread gnus-summary-goto-subject bbb-summary-rate-article 3 4 t zerop gnus-summary-next-subject 1 gnus-summary-recenter gnus-summary-position-point gnus-set-mode-line summary] 5 (#$ . 16007) "nRating: "])
(defalias 'bbb-exit-group #[nil "\300 \210\301 \207" [bbb-put-ratings bbb-renew-hash-table] 1])
(defalias 'bbb-get-current-id #[nil "\203 \301H\207\302\303\304\"\207" [gnus-current-headers 4 gnus-message 3 "You must select an article before you rate it"] 3])
#@41 Say whether GROUP is a GroupLens group.
(defalias 'bbb-grouplens-group-p #[(group) "	\235\203 \302\207\303\207" [group grouplens-newsgroups " (GroupLens Enhanced)" ""] 2 (#$ . 16851)])
(byte-code "\301B\302\301!\204\f \303\303\207" [current-load-list grouplens-current-starting-time boundp nil] 2)
(defalias 'grouplens-start-timer #[nil "\301 \211\207" [grouplens-current-starting-time current-time] 2])
(defalias 'grouplens-elapsed-time #[nil "\302\303 !\211\302	!Z)\207" [et grouplens-current-starting-time bbb-time-float current-time] 4])
(defalias 'bbb-time-float #[(timeval) "@\302_\211A@)\\\207" [timeval x 65536] 3])
(defalias 'grouplens-do-time #[nil "	\235\2055 \n\203. \306 \307\n\"\f\204! \n\310BBB\202- \f\211\211A@)B\241\210*\311 \210\312 \211\207" [gnus-newsgroup-name grouplens-newsgroups grouplens-previous-article grouplens-rating-alist oldrating elapsed-time grouplens-elapsed-time assoc 0 grouplens-start-timer bbb-get-current-id x] 4])
(byte-code "\301B\303\302B\304\301\207" [current-load-list gnus-gl-version gnus-gl-maintainer-address "gnus-gl.el 2.50" "grouplens-bug@cs.umn.edu"] 2)
#@42 Submit via mail a bug report on gnus-gl.
(defalias 'gnus-gl-submit-bug-report #[nil "\302\303!\210\304\305	P\306\307\310\311\312\313\314\315\257\316\317%\207" [gnus-gl-maintainer-address gnus-gl-version require reporter reporter-submit-bug-report "gnus-gl.el " grouplens-pseudonym grouplens-bbb-host grouplens-bbb-port grouplens-newsgroups grouplens-bbb-token grouplens-bbb-process grouplens-current-group grouplens-previous-article nil gnus-gl-get-trace] 11 (#$ . 17991) nil])
#@47 Insert the contents of the BBBD trace buffer.
(defalias 'gnus-gl-get-trace #[nil "\205 \301!\207" [grouplens-bbb-buffer insert-buffer-substring] 2 (#$ . 18477)])
#@73 Minor mode for providing a GroupLens interface in Gnus summary buffers.
(defvar gnus-grouplens-mode nil (#$ . 18648))
(byte-code "\301B\302\301!\204\f \303	\204 \304 \305\301\306\"\210\303\207" [current-load-list gnus-grouplens-mode-map boundp nil make-keymap gnus-define-keys-1 ("n" grouplens-next-unread-article "r" bbb-summary-rate-article "k" grouplens-score-thread "c" grouplens-summary-catchup-and-exit "," grouplens-best-unread-article)] 3)
(defalias 'gnus-grouplens-make-menu-bar #[nil "\302\300!?\205 \303\300\304\305#\210\302\300!\204 \306\307\300	\305\310$\207" [gnus-grouplens-menu gnus-grouplens-mode-map boundp put variable-documentation "" nil easy-menu-do-define ("GroupLens" ["Login" bbb-login t] ["Rate" bbb-summary-rate-article t] ["Next article" grouplens-next-unread-article t] ["Best article" grouplens-best-unread-article t] ["Raise thread" grouplens-score-thread t] ["Report bugs" gnus-gl-submit-bug-report t])] 5])
#@73 Minor mode for providing a GroupLens interface in Gnus summary buffers.
(defalias 'gnus-grouplens-mode #[(&optional arg) "\306=\205\235 	\n\235\205\235 \307\304!\210\204 \f?\202 \310!\311V\211\205\235 \312\313!\210\314\313\315\316\317$\210\312\320!\210\314\320\321\316\317$\210\307\322!\210\323=\203\\ <\203S \324\325\"\202m \325D\202m \326=\203j \314\327\330\"\210\202m \325\307\331!\210\307\332!\210&\316\333\316\334\"\210\335 \210'\203\223 \336\337\340\"\203\223 \341 \210\342\304\343(#\210\344\345!\207" [major-mode gnus-newsgroup-name grouplens-newsgroups arg gnus-grouplens-mode gnus-grouplens-override-scoring gnus-summary-mode make-local-variable prefix-numeric-value 0 make-local-hook gnus-select-article-hook add-hook grouplens-do-time nil local gnus-exit-group-hook bbb-exit-group gnus-score-find-score-files-function combine append bbb-build-mid-scores-alist separate gnus-select-group-hook #[nil "\301\302 \"\207" [gnus-newsgroup-name bbb-get-predictions bbb-get-all-mids] 3] gnus-summary-line-format gnus-summary-line-format-spec gnus-update-format-specifications summary gnus-update-summary-mark-positions gnus-visual-p grouplens-menu menu gnus-grouplens-make-menu-bar gnus-add-minor-mode " GroupLens" gnus-run-hooks gnus-grouplens-mode-hook gnus-summary-grouplens-line-format menu-bar-mode gnus-grouplens-mode-map] 6 (#$ . 19602) "P"])
(provide 'gnus-gl)
