annotate lisp/gnus/nndb.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 0293115a14e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; nndb.el --- nndb access for Gnus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Copyright (C) 1996 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Author: Kai Grossjohann <grossjohann@ls6.informatik.uni-dortmund.de>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Keywords: news
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; I have shamelessly snarfed the code of nntp.el from sgnus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; Kai
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; Register nndb with known select methods.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (setq gnus-valid-select-methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (cons '("nndb" mail address respool prompt-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 gnus-valid-select-methods))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (require 'nnheader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (require 'nntp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (eval-when-compile (require 'cl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (unless (fboundp 'open-network-stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (require 'tcp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (eval-when-compile (require 'cl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (autoload 'news-setup "rnewspost")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (autoload 'news-reply-mode "rnewspost")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (autoload 'cancel-timer "timer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (autoload 'telnet "telnet" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (autoload 'telnet-send-input "telnet" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (autoload 'timezone-parse-date "timezone"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;; Declare nndb as derived from nntp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (nnoo-declare nndb nntp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;; Variables specific to nndb
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;;- currently not used but just in case...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (defvoo nndb-deliver-program "nndel"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 "*The program used to put a message in an NNDB group.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;; Variables copied from nntp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (defvoo nndb-server-opened-hook '(nntp-send-authinfo-from-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 "Like nntp-server-opened-hook."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 nntp-server-opened-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;(defvoo nndb-rlogin-parameters '("telnet" "${NNDBSERVER:=localhost}" "9000")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ; "*Parameters to nndb-open-login. Like nntp-rlogin-parameters."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ; nntp-rlogin-parameters)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ;(defvoo nndb-rlogin-user-name nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ; "*User name for rlogin connect method."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ; nntp-rlogin-user-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (defvoo nndb-address "localhost"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 "*The name of the NNDB server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 nntp-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (defvoo nndb-port-number 9000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 "*Port number to connect to."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 nntp-port-number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ;(defvoo nndb-current-group ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ; "Like nntp-current-group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ; nntp-current-group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (defvoo nndb-status-string nil "" nntp-status-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (defconst nndb-version "nndb 0.3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 "Version numbers of this version of NNDB.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ;;; Interface functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (nnoo-define-basics nndb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ;; Import other stuff from nntp as is.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (nnoo-import nndb
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (nntp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ;;- maybe this should be mail??
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 ;;-(defun nndb-request-type (group &optional article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ;;- 'news)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 ;;------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ;;- only new stuff below
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ; nndb-request-update-info does not exist and is not needed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ; nndb-request-update-mark does not exist and is not needed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ; nndb-request-scan does not exist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ; get new mail from somewhere -- maybe this is not needed?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ; --> todo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (deffoo nndb-request-create-group (group &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 "Creates a group if it doesn't exist yet."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (nntp-send-command "^[23].*\n" "MKGROUP" group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ; todo -- use some other time than the creation time of the article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ; best is time since article has been marked as expirable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (deffoo nndb-request-expire-articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (articles &optional group server force)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 "Expires ARTICLES from GROUP on SERVER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 If FORCE, delete regardless of exiration date, otherwise use normal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 expiry mechanism."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (let (msg art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (nntp-possibly-change-server group server) ;;-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (while articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (setq art (pop articles))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (nntp-send-command "^\\([23]\\|^423\\).*\n" "DATE" art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (setq msg (nndb-status-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ;; CCC we shouldn't be using the variable nndb-status-string?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (if (string-match "^423" (nnheader-get-report 'nndb))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (or (string-match "\\([0-9]+\\) \\([0-9]+\\)$" msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (error "Not a valid response for DATE command: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 msg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (if (nnmail-expired-article-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (list (string-to-int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (substring msg (match-beginning 1) (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (string-to-int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (substring msg (match-beginning 2) (match-end 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 force)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (nnheader-message 5 "Deleting article %s in %s..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 art group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (nntp-send-command "^[23].*\n" "DELETE" art))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (deffoo nndb-request-move-article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (article group server accept-form &optional last)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 "Move ARTICLE (a number) from GROUP on SERVER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 Evals ACCEPT-FORM in current buffer, where the article is.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 Optional LAST is ignored."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (let ((artbuf (get-buffer-create " *nndb move*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (nndb-request-article article group server artbuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (set-buffer artbuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (setq result (eval accept-form))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (kill-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (nndb-request-expire-articles (list article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 server
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (deffoo nndb-request-accept-article (group server &optional last)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 "The article in the current buffer is put into GROUP."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (nntp-possibly-change-server group server) ;;-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (let (art statmsg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (when (nntp-send-command "^[23].*\r?\n" "ACCEPT" group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (nnheader-insert "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (nntp-encode-text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (nntp-send-region-to-server (point-min) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ;; 1.2a NNTP's post command is buggy. "^M" (\r) is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;; appended to end of the status message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (nntp-wait-for-response "^[23].*\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (setq statmsg (nntp-status-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (or (string-match "^\\([0-9]+\\)" statmsg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (error "nndb: %s" statmsg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (setq art (substring statmsg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (message "nndb: accepted %s" art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (list art))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (deffoo nndb-request-replace-article (article group buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 "ARTICLE is the number of the article in GROUP to be replaced
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 with the contents of the BUFFER."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (let (art statmsg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (when (nntp-send-command "^[23].*\r?\n" "REPLACE" (int-to-string article))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (nnheader-insert "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (nntp-encode-text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (nntp-send-region-to-server (point-min) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ;; 1.2a NNTP's post command is buggy. "^M" (\r) is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ;; appended to end of the status message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (nntp-wait-for-response "^[23].*\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ; (setq statmsg (nntp-status-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 ; (or (string-match "^\\([0-9]+\\)" statmsg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ; (error "nndb: %s" statmsg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 ; (setq art (substring statmsg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ; (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ; (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 ; (message "nndb: replaced %s" art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (list (int-to-string article)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 ; nndb-request-delete-group does not exist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 ; todo -- maybe later
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ; nndb-request-rename-group does not exist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 ; todo -- maybe later
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (provide 'nndb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229