annotate lisp/gnus/nndb.el @ 108:360340f9fd5f r20-1b6

Import from CVS: tag r20-1b6
author cvs
date Mon, 13 Aug 2007 09:18:39 +0200
parents 0d2f883870bc
children b980b6286996
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
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2 ;; Copyright (C) 1996,97 Free Software Foundation, Inc.
0
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
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
33 (require 'gnus)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
34 (require 'nnmail)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
35
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (setq gnus-valid-select-methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (cons '("nndb" mail address respool prompt-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 gnus-valid-select-methods))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (require 'nnheader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (require 'nntp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (eval-when-compile (require 'cl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (unless (fboundp 'open-network-stream)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (require 'tcp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (eval-when-compile (require 'cl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (autoload 'news-setup "rnewspost")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (autoload 'news-reply-mode "rnewspost")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (autoload 'cancel-timer "timer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (autoload 'telnet "telnet" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (autoload 'telnet-send-input "telnet" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (autoload 'timezone-parse-date "timezone"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;; Declare nndb as derived from nntp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (nnoo-declare nndb nntp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;; Variables specific to nndb
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;;- currently not used but just in case...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (defvoo nndb-deliver-program "nndel"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 "*The program used to put a message in an NNDB group.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;; Variables copied from nntp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (defvoo nndb-server-opened-hook '(nntp-send-authinfo-from-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 "Like nntp-server-opened-hook."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 nntp-server-opened-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;(defvoo nndb-rlogin-parameters '("telnet" "${NNDBSERVER:=localhost}" "9000")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ; "*Parameters to nndb-open-login. Like nntp-rlogin-parameters."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ; nntp-rlogin-parameters)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ;(defvoo nndb-rlogin-user-name nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ; "*User name for rlogin connect method."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ; nntp-rlogin-user-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (defvoo nndb-address "localhost"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 "*The name of the NNDB server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 nntp-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (defvoo nndb-port-number 9000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 "*Port number to connect to."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 nntp-port-number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ;(defvoo nndb-current-group ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ; "Like nntp-current-group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ; nntp-current-group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (defvoo nndb-status-string nil "" nntp-status-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (defconst nndb-version "nndb 0.3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 "Version numbers of this version of NNDB.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ;;; Interface functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (nnoo-define-basics nndb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ;; Import other stuff from nntp as is.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (nnoo-import nndb
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (nntp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 ;;- maybe this should be mail??
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 ;;-(defun nndb-request-type (group &optional article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ;;- 'news)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ;;------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ;;- only new stuff below
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ; nndb-request-update-info does not exist and is not needed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ; nndb-request-update-mark does not exist and is not needed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ; nndb-request-scan does not exist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ; get new mail from somewhere -- maybe this is not needed?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ; --> todo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
129 (deffoo nndb-request-create-group (group &optional server args)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 "Creates a group if it doesn't exist yet."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (nntp-send-command "^[23].*\n" "MKGROUP" group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ; todo -- use some other time than the creation time of the article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ; best is time since article has been marked as expirable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (deffoo nndb-request-expire-articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (articles &optional group server force)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 "Expires ARTICLES from GROUP on SERVER.
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
138 If FORCE, delete regardless of expiration date, otherwise use normal
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 expiry mechanism."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (let (msg art)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
141 (nntp-possibly-change-group group server) ;;-
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (while articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (setq art (pop articles))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (nntp-send-command "^\\([23]\\|^423\\).*\n" "DATE" art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (setq msg (nndb-status-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; CCC we shouldn't be using the variable nndb-status-string?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (if (string-match "^423" (nnheader-get-report 'nndb))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 ()
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
149 (unless (string-match "\\([0-9]+\\) \\([0-9]+\\)$" msg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
150 (error "Not a valid response for DATE command: %s"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
151 msg))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (if (nnmail-expired-article-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (list (string-to-int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (substring msg (match-beginning 1) (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (string-to-int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (substring msg (match-beginning 2) (match-end 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 force)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (nnheader-message 5 "Deleting article %s in %s..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 art group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (nntp-send-command "^[23].*\n" "DELETE" art))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (deffoo nndb-request-move-article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (article group server accept-form &optional last)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 "Move ARTICLE (a number) from GROUP on SERVER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 Evals ACCEPT-FORM in current buffer, where the article is.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 Optional LAST is ignored."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (let ((artbuf (get-buffer-create " *nndb move*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (nndb-request-article article group server artbuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (set-buffer artbuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (setq result (eval accept-form))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (kill-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (nndb-request-expire-articles (list article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 server
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 result))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
182
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (deffoo nndb-request-accept-article (group server &optional last)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 "The article in the current buffer is put into GROUP."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
185 (nntp-possibly-change-group group server) ;;-
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (let (art statmsg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (when (nntp-send-command "^[23].*\r?\n" "ACCEPT" group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (nnheader-insert "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (nntp-encode-text)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
190 (nntp-send-buffer "^[23].*\n")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (setq statmsg (nntp-status-message))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
192 (unless (string-match "^\\([0-9]+\\)" statmsg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
193 (error "nndb: %s" statmsg))
0
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)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
201 "ARTICLE is the number of the article in GROUP to be replaced
0
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)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
208 (nntp-send-buffer "^[23].*\n")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ; (setq statmsg (nntp-status-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ; (or (string-match "^\\([0-9]+\\)" statmsg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 ; (error "nndb: %s" statmsg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ; (setq art (substring statmsg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 ; (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ; (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 ; (message "nndb: replaced %s" art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (list (int-to-string article)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 ; nndb-request-delete-group does not exist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 ; todo -- maybe later
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-rename-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 (provide 'nndb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226