* wl-vars.el (wl-nntp-posting-config-alist): New variable.
authorokada <okada>
Sat, 18 May 2002 14:03:36 +0000 (14:03 +0000)
committerokada <okada>
Sat, 18 May 2002 14:03:36 +0000 (14:03 +0000)
(wl-nntp-posting-function): New variable.
* wl-draft.el (wl-draft-elmo-nntp-send): Change for
`wl-nntp-posting-config-alist'.

doc/wl-ja.texi
doc/wl.texi
wl/ChangeLog
wl/wl-draft.el
wl/wl-vars.el

index 38c277a..ce357c4 100644 (file)
@@ -4707,6 +4707,17 @@ SMTP \e$B$N%3%M%/%7%g%s$r$I$N$h$&$KD%$k$+$r;XDj$7$^$9!#\e(B
 Non-nil \e$B$J$i%K%e!<%9Ej9F;~$K\e(B SSL \e$B$rMxMQ$7$^$9!#\e(B
 @code{starttls}\e$B$J$i\e(B STARTTLS (RFC2595)\e$B$rMxMQ$7$F%3%M%/%7%g%s$rD%$j$^$9!#\e(B
 
+@item wl-nntp-posting-function
+@vindex wl-nntp-posting-function
+\e$B=i4|@_Dj$O\e(B @code{elmo-nntp-post}\e$B!#\e(B
+\e$B%K%e!<%9Ej9F$N$?$a$N4X?t!#\e(B
+
+@item wl-nntp-posting-config-alist
+@vindex wl-nntp-posting-config-alist
+\e$B=i4|@_Dj$O\e(B @code{nil}\e$B!#\e(B
+\e$B%K%e!<%9Ej9F;~$N%5!<%PA*BrJ}K!$r@_Dj$7$^$9!#\e(B
+@code{wl-nntp-posting-{server|user|port|function}}\e$B$h$jM%@h$5$l$^$9!#\e(B
+
 @item wl-pop-before-smtp-user
 @vindex wl-pop-before-smtp-user
 \e$B=i4|@_Dj$O\e(B @code{nil}\e$B!#\e(B
index 504a9f1..6761fdf 100644 (file)
@@ -4768,6 +4768,16 @@ If @code{nil}, @code{elmo-nntp-default-stream-type} is evaluated.  If non-nil,
 SSL is used for news submission.  If @code{starttls}, STARTTLS (RFC2595)
 connection will be established.
 
+@item wl-nntp-posting-function
+@vindex wl-nntp-posting-function
+The initial setting is @code{elmo-nntp-post}.
+This is the function to post NNTP message.
+
+@item wl-nntp-posting-config-alist
+@vindex wl-nntp-posting-config-alist
+The initial setting is @code{nil}.
+An alist to define NNTP server.
+
 @item wl-pop-before-smtp-user
 @vindex wl-pop-before-smtp-user
 The initial setting is @code{nil}.
index be5cc7a..bf76075 100644 (file)
@@ -1,3 +1,10 @@
+2002-05-18  Kenichi OKADA  <okada@opaopa.org>
+
+       * wl-vars.el (wl-nntp-posting-config-alist): New variable.
+       (wl-nntp-posting-function): New variable.
+       * wl-draft.el (wl-draft-elmo-nntp-send): Change for
+       `wl-nntp-posting-config-alist'.
+
 2002-05-17  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
 
        * wl-draft.el (wl-draft-send-mail-with-smtp): Remove staff for older
index a87e6af..446886f 100644 (file)
@@ -1247,7 +1247,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
            (expand-abbrev) ; for mail-abbrevs
            (let ((mime-header-encode-method-alist
                   (append
-                   '((wl-draft-eword-encode-address-list 
+                   '((wl-draft-eword-encode-address-list
                       .  (To Cc Bcc Resent-To Resent-Cc Bcc Resent-Bcc)))
                    (if (boundp 'mime-header-encode-method-alist)
                        (symbol-value 'mime-header-encode-method-alist)))))
@@ -1729,12 +1729,27 @@ Derived from `message-save-drafts' in T-gnus."
        (elmo-nntp-default-port
         (or wl-nntp-posting-port elmo-nntp-default-port))
        (elmo-nntp-default-stream-type
-        (or wl-nntp-posting-stream-type elmo-nntp-default-stream-type)))
+        (or wl-nntp-posting-stream-type elmo-nntp-default-stream-type))
+       (elmo-nntp-default-function wl-nntp-posting-function)
+       condition)
+    (if (setq condition (cdr (elmo-string-matched-assoc
+                             (std11-field-body "Newsgroups")
+                             wl-nntp-posting-config-alist)))
+       (if (stringp condition)
+           (setq elmo-nntp-default-server condition)
+         (while (car condition)
+           (set (intern (format "elmo-nntp-default-%s"
+                                (symbol-name (caar condition))))
+                (cdar condition))
+           (setq condition (cdr condition)))))
+    (unless elmo-nntp-default-function
+      (error "wl-draft-nntp-send: posting-function is nil."))
     (if (not (elmo-plugged-p elmo-nntp-default-server elmo-nntp-default-port))
        (wl-draft-set-sent-message 'news 'unplugged
                                   (cons elmo-nntp-default-server
                                         elmo-nntp-default-port))
-      (elmo-nntp-post elmo-nntp-default-server (current-buffer))
+      (funcall elmo-nntp-default-function
+              elmo-nntp-default-server (current-buffer))
       (wl-draft-set-sent-message 'news 'sent)
       (wl-draft-write-sendlog 'ok 'nntp elmo-nntp-default-server
                              (std11-field-body "Newsgroups")
index 823c595..5e113e3 100644 (file)
@@ -523,6 +523,33 @@ If nil, `elmo-nntp-default-port' is used."
 If nil, `elmo-nntp-default-stream-type' is used."
   :type 'boolean
   :group 'wl)
+(defcustom wl-nntp-posting-function 'elmo-nntp-post
+  "A function to post news.
+Prepared candidate is 'elmo-nntp-post."
+  :type '(radio (function-item elmo-nntp-post)
+               (function :tag "Other"))
+  :group 'wl-draft)
+(defcustom wl-nntp-posting-config-alist nil
+  "*Alist of configuration on nntp posting.
+ex.
+'((\",?local.test\" . \"news.media.kyoto-u.ac.jp\")
+  (\",?ku\\.\" .
+   ((server . \"news.media.kyoto-u.ac.jp\")
+    (user . \"newsmaster\")
+    (port . 119)
+    (function . elmo-nntp-post))
+  (\".*\" . \"newsfeed.kuee.kyoto-u.ac.jp\")))"
+  :type '(repeat (cons (sexp :tag "Match")
+                      (choice (string :tag "Server")
+                              (repeat :inlie t
+                                      (cons (choice (const server)
+                                                    (const user)
+                                                    (const port)
+                                                    (const stream-type)
+                                                    (const function))
+                                            (sexp :tag "Value"))))))
+  :group 'wl-draft
+  :group 'wl-setting)
 
 (defcustom wl-prefetch-confirm t
   "*Confirm prefetching if message size is larger than `wl-prefetch-threshold'."