X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-int.el;h=fbb50dbbd20fe5b4d605299c6a2971b83986b10e;hb=e0ee864516f27fd96f9edb4b3a0313db148abf21;hp=bdd0227b8481142ee73c7483f1c27e59185ad160;hpb=d42d12a0888ebd196ed1f29c7d662dc5db1bd278;p=gnus diff --git a/lisp/gnus-int.el b/lisp/gnus-int.el index bdd0227b8..fbb50dbbd 100644 --- a/lisp/gnus-int.el +++ b/lisp/gnus-int.el @@ -1,5 +1,5 @@ ;;; gnus-int.el --- backend interface functions for Gnus -;; Copyright (C) 1996, 1997, 1998, 1999, 2000 +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen @@ -70,8 +70,7 @@ If CONFIRM is non-nil, the user will be asked for an NNTP server." (list 'nnmh-directory (file-name-as-directory (expand-file-name - (concat "~/" (substring - gnus-nntp-server 1))))) + (substring gnus-nntp-server 1) "~/"))) (list 'nnmh-get-new-mail nil))) (t (list 'nntp gnus-nntp-server))))) @@ -111,7 +110,8 @@ If CONFIRM is non-nil, the user will be asked for an NNTP server." "Check whether the connection to METHOD is down. If METHOD is nil, use `gnus-select-method'. If it is down, start it up (again)." - (let ((method (or method gnus-select-method))) + (let ((method (or method gnus-select-method)) + result) ;; Transform virtual server names into select methods. (when (stringp method) (setq method (gnus-server-to-method method))) @@ -125,9 +125,15 @@ If it is down, start it up (again)." (format " on %s" (nth 1 method))))) (gnus-run-hooks 'gnus-open-server-hook) (prog1 - (gnus-open-server method) + (condition-case () + (setq result (gnus-open-server method)) + (quit (message "Quit gnus-check-server") + nil)) (unless silent - (message "")))))) + (gnus-message 5 "Opening %s server%s...%s" (car method) + (if (equal (nth 1 method) "") "" + (format " on %s" (nth 1 method))) + (if result "done" "failed"))))))) (defun gnus-get-function (method function &optional noerror) "Return a function symbol based on METHOD and FUNCTION." @@ -177,9 +183,13 @@ If it is down, start it up (again)." nil) ;; Open the server. (let ((result - (funcall (gnus-get-function gnus-command-method 'open-server) - (nth 1 gnus-command-method) - (nthcdr 2 gnus-command-method)))) + (condition-case () + (funcall (gnus-get-function gnus-command-method 'open-server) + (nth 1 gnus-command-method) + (nthcdr 2 gnus-command-method)) + (quit + (message "Quit trying to open server") + nil)))) ;; If this hasn't been opened before, we add it to the list. (unless elem (setq elem (list gnus-command-method nil) @@ -458,11 +468,13 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned." (unless (bolp) (insert "\n")) (unless no-encode - (save-restriction - (message-narrow-to-head) - (let ((mail-parse-charset message-default-charset)) - (mail-encode-encoded-word-buffer))) - (message-encode-message-body)) + (let ((message-options message-options)) + (message-options-set-recipient) + (save-restriction + (message-narrow-to-head) + (let ((mail-parse-charset message-default-charset)) + (mail-encode-encoded-word-buffer))) + (message-encode-message-body))) (let ((func (car (or gnus-command-method (gnus-find-method-for-group group))))) (funcall (intern (format "%s-request-accept-article" func)) @@ -472,11 +484,13 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned." (defun gnus-request-replace-article (article group buffer &optional no-encode) (unless no-encode - (save-restriction - (message-narrow-to-head) - (let ((mail-parse-charset message-default-charset)) - (mail-encode-encoded-word-buffer))) - (message-encode-message-body)) + (let ((message-options message-options)) + (message-options-set-recipient) + (save-restriction + (message-narrow-to-head) + (let ((mail-parse-charset message-default-charset)) + (mail-encode-encoded-word-buffer))) + (message-encode-message-body))) (let ((func (car (gnus-group-name-to-method group)))) (funcall (intern (format "%s-request-replace-article" func)) article (gnus-group-real-name group) buffer)))