projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[gnus]
/
lisp
/
nndb.el
diff --git
a/lisp/nndb.el
b/lisp/nndb.el
index
f7644fa
..
a7029ab
100644
(file)
--- a/
lisp/nndb.el
+++ b/
lisp/nndb.el
@@
-30,6
+30,10
@@
;;-
;; Register nndb with known select methods.
;;-
;; Register nndb with known select methods.
+(require 'gnus)
+(require 'gnus-load)
+(require 'nnmail)
+
(setq gnus-valid-select-methods
(cons '("nndb" mail address respool prompt-address)
gnus-valid-select-methods))
(setq gnus-valid-select-methods
(cons '("nndb" mail address respool prompt-address)
gnus-valid-select-methods))
@@
-103,6
+107,11
@@
(nnoo-define-basics nndb)
(nnoo-define-basics nndb)
+;; Import other stuff from nntp as is.
+
+(nnoo-import nndb
+ (nntp))
+
;;- maybe this should be mail??
;;-(defun nndb-request-type (group &optional article)
;;- 'news)
;;- maybe this should be mail??
;;-(defun nndb-request-type (group &optional article)
;;- 'news)
@@
-118,7
+127,7
@@
; get new mail from somewhere -- maybe this is not needed?
; --> todo
; get new mail from somewhere -- maybe this is not needed?
; --> todo
-(deffoo nndb-request-create-group (group &optional server)
+(deffoo nndb-request-create-group (group &optional server
args
)
"Creates a group if it doesn't exist yet."
(nntp-send-command "^[23].*\n" "MKGROUP" group))
"Creates a group if it doesn't exist yet."
(nntp-send-command "^[23].*\n" "MKGROUP" group))
@@
-127,10
+136,10
@@
(deffoo nndb-request-expire-articles
(articles &optional group server force)
"Expires ARTICLES from GROUP on SERVER.
(deffoo nndb-request-expire-articles
(articles &optional group server force)
"Expires ARTICLES from GROUP on SERVER.
-If FORCE, delete regardless of exiration date, otherwise use normal
+If FORCE, delete regardless of ex
p
iration date, otherwise use normal
expiry mechanism."
(let (msg art)
expiry mechanism."
(let (msg art)
- (nntp-possibly-change-
server
group server) ;;-
+ (nntp-possibly-change-
group
group server) ;;-
(while articles
(setq art (pop articles))
(nntp-send-command "^\\([23]\\|^423\\).*\n" "DATE" art)
(while articles
(setq art (pop articles))
(nntp-send-command "^\\([23]\\|^423\\).*\n" "DATE" art)
@@
-138,9
+147,9
@@
expiry mechanism."
;; CCC we shouldn't be using the variable nndb-status-string?
(if (string-match "^423" (nnheader-get-report 'nndb))
()
;; CCC we shouldn't be using the variable nndb-status-string?
(if (string-match "^423" (nnheader-get-report 'nndb))
()
- (
or
(string-match "\\([0-9]+\\) \\([0-9]+\\)$" msg)
-
(error "Not a valid response for DATE command: %s"
-
msg))
+ (
unless
(string-match "\\([0-9]+\\) \\([0-9]+\\)$" msg)
+ (error "Not a valid response for DATE command: %s"
+ msg))
(if (nnmail-expired-article-p
group
(list (string-to-int
(if (nnmail-expired-article-p
group
(list (string-to-int
@@
-174,18
+183,15
@@
Optional LAST is ignored."
(deffoo nndb-request-accept-article (group server &optional last)
"The article in the current buffer is put into GROUP."
(deffoo nndb-request-accept-article (group server &optional last)
"The article in the current buffer is put into GROUP."
- (nntp-possibly-change-
server
group server) ;;-
+ (nntp-possibly-change-
group
group server) ;;-
(let (art statmsg)
(when (nntp-send-command "^[23].*\r?\n" "ACCEPT" group)
(nnheader-insert "")
(nntp-encode-text)
(let (art statmsg)
(when (nntp-send-command "^[23].*\r?\n" "ACCEPT" group)
(nnheader-insert "")
(nntp-encode-text)
- (nntp-send-region-to-server (point-min) (point-max))
- ;; 1.2a NNTP's post command is buggy. "^M" (\r) is not
- ;; appended to end of the status message.
- (nntp-wait-for-response "^[23].*\n")
+ (nntp-send-buffer "^[23].*\n")
(setq statmsg (nntp-status-message))
(setq statmsg (nntp-status-message))
- (
or
(string-match "^\\([0-9]+\\)" statmsg)
-
(error "nndb: %s" statmsg))
+ (
unless
(string-match "^\\([0-9]+\\)" statmsg)
+ (error "nndb: %s" statmsg))
(setq art (substring statmsg
(match-beginning 1)
(match-end 1)))
(setq art (substring statmsg
(match-beginning 1)
(match-end 1)))
@@
-200,10
+206,7
@@
with the contents of the BUFFER."
(when (nntp-send-command "^[23].*\r?\n" "REPLACE" (int-to-string article))
(nnheader-insert "")
(nntp-encode-text)
(when (nntp-send-command "^[23].*\r?\n" "REPLACE" (int-to-string article))
(nnheader-insert "")
(nntp-encode-text)
- (nntp-send-region-to-server (point-min) (point-max))
- ;; 1.2a NNTP's post command is buggy. "^M" (\r) is not
- ;; appended to end of the status message.
- (nntp-wait-for-response "^[23].*\n")
+ (nntp-send-buffer "^[23].*\n")
; (setq statmsg (nntp-status-message))
; (or (string-match "^\\([0-9]+\\)" statmsg)
; (error "nndb: %s" statmsg))
; (setq statmsg (nntp-status-message))
; (or (string-match "^\\([0-9]+\\)" statmsg)
; (error "nndb: %s" statmsg))
@@
-219,15
+222,6
@@
with the contents of the BUFFER."
; nndb-request-rename-group does not exist
; todo -- maybe later
; nndb-request-rename-group does not exist
; todo -- maybe later
-;; Import stuff from nntp
-
-
-
-;; Import other stuff from nntp as is.
-
-(nnoo-import nndb
- (nntp))
-
(provide 'nndb)
(provide 'nndb)