Article View: gnu.emacs.gnus
Article #588Source: description of newsgroups via NNRP
From: Dirk Lutzebaeck
Date: Fri, 08 Jan 1993 15:02
Date: Fri, 08 Jan 1993 15:02
81 lines
3705 bytes
3705 bytes
Hi all,
The NNRP protocol (which is a variation of the NNTP protocol used in
the INN news administration package, I think) provides a command named
`XGTITLE'. This command takes a newsgroup as an argument and returns
a short description of it. I made this available to GNUS, i.e. if you
press `i' in the group, subject or killed groups buffer it looks for a
newsgroup at the current point and prints the description in the
minibuffer. A prefix `C-u i' asks for a newsgroup name. Another
command `I' in the group buffer gives you the description of all
available newsgroups of your NNRP server.
REMEMBER: THIS ONLY WORKS IF YOU'RE RUNNING GNUS VIA A *NNRP* SERVER!
(probably an INN 1.2 site)
NNTP AND NNSPOOL WILL NOT WORK!
HINT: If you DO NOT KNOW if your news server is an NNRP or an NNTP server
simply connect to the server via telnet and check the init message
from the server: `telnet <your-nn[tr]p-server-address> 119'
It should read something like this:
"200 mailgzrz.TU-Berlin.DE InterNetNews NNRP server INN 1.2 10-Sep-92 ready."
So here is the code which you can put in your .emacs or your favorite
gnus setup file:
-----------------------------------------------------------------------------
(define-key gnus-Group-mode-map "i" 'gnus-Group-describe)
(define-key gnus-Group-mode-map "I" 'gnus-Group-describe-all)
(define-key gnus-Subject-mode-map "i" 'gnus-Group-describe)
(define-key gnus-Browse-killed-mode-map "i" 'gnus-Group-describe)
(defun gnus-Group-describe (&optional group)
"Describe current newsgroup.
If optional argument GROUP is non-nil ask for a newsgroup, otherwise
search around point for a newsgroup. If no newsgroup found take
current newsgroup."
(interactive "P")
(cond
((not group)
(setq group (gnus-Group-group-name))) ; search around point
((listp group)
(setq group
(completing-read "Newsgroup: "
gnus-newsrc-assoc nil 'require-match))))
(if (not group)
(setq group gnus-newsgroup-name)) ; otherwise set current newsgroup name
(if (nntp-request-xgtitle group)
(save-excursion
(set-buffer nntp-server-buffer)
(if (> (point-max) (point-min))
(message (buffer-substring (point-min) (- (point-max) 1)))
(message "%s no description." group)))
(message "cannot find description for %s." group)))
(defun gnus-Group-describe-all ()
"Describe all newsgroups."
(interactive)
(switch-to-buffer (get-buffer-create " *GNUS newsgroup descriptions*"))
(erase-buffer)
(if (nntp-request-xgtitle "*")
(insert-buffer-substring nntp-server-buffer))
(goto-char (point-min)))
(defun nntp-request-xgtitle (group)
"Get description of a group via XGTITLE NNRP-command."
(prog1
(nntp-send-command "^\\.\r$" "XGTITLE" group)
(nntp-decode-text)))
--------------------------------------------------------------------------------
--
Dirk Lutzebaeck | Email: lutzeb@cs.tu-berlin.de | (**( )
TU Berlin, Sekr. 6-10 | Tel: +49-30-314-25586 | (**( . ) I don't think,
Franklinstr. 28-29 | FAX: +49-30-314-73622 | (*.*) ) so I am.
D-1000 Berlin 12 | Room: FR6079 | (*) )
Technical Details
Message-ID:
<LUTZEB.93Jan8160208@flp.cs.tu-berlin.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!mailgzrz.tu-berlin.de!lutzebShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!mailgzrz.tu-berlin.de!lutzeb From: lutzeb@cs.tu-berlin.de (Dirk Lutzebaeck) Newsgroups: gnu.emacs.gnus Subject: Source: description of newsgroups via NNRP Date: 08 Jan 93 15:02:08 GMT Organization: Computer Science Department, Technical University Berlin, Germany Lines: 81 Distribution: gnu Message-ID: <LUTZEB.93Jan8160208@flp.cs.tu-berlin.de> Reply-To: lutzeb@cs.tu-berlin.de NNTP-Posting-Host: flp.cs.tu-berlin.de