+2007-11-28 Elias Oltmanns <eo@nebensachen.de>
+
+ * gnus.el (gnus-method-to-server): Add an optional parameter so the
+ caller can indicate whether the cache should be disregarded for this
+ call. This way the result of the call is reproducible at all times and
+ can be considered a canonical server name for the supplied method.
+ (gnus-agent-method-p): Canonicalize server names by pushing their
+ method through `gnus-method-to-server' using the no-cache argument.
+
+ * gnus-srvr.el (gnus-server-insert-server-line): Call
+ `gnus-method-to-server' with `no-cache' argument.
+
+ * gnus-agent.el (gnus-agent-toggle-plugged): Don't call
+ gnus-agent-possibly-synchronize-flags as this should be called when the
+ server is actually being opened.
+ (gnus-agent-possibly-synchronize-flags)
+ (gnus-agent-possibly-synchronize-flags-server): Move check for the
+ flags file of an agentized server to the latter function.
+
+ * gnus-int.el (gnus-agent-possibly-synchronize-flags-server): Autoload.
+ (gnus-open-server): Call gnus-agent-possibly-synchronize-flags-server
+ after a connection has been established successfully.
+
2007-11-28 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (article-display-face): Force to display face if called
* gnus-msg.el (gnus-summary-reply): Ignore
gnus-confirm-mail-reply-to-news for wide and very wide replies.
-2007-11-24 Elias Oltmanns <eo@nebensachen.de>
-
- * gnus.el (gnus-method-to-server): Add an optional parameter so the
- caller can indicate whether the cache should be disregarded for this
- call. This way the result of the call is reproducible at all times and
- can be considered a canonical server name for the supplied method.
- (gnus-agent-method-p): Canonicalize server names by pushing their
- method through `gnus-method-to-server' using the no-cache argument.
-
- * gnus-srvr.el (gnus-server-insert-server-line): Call
- `gnus-method-to-server' with `no-cache' argument.
-
- * gnus-agent.el (gnus-agent-toggle-plugged): Don't call
- gnus-agent-possibly-synchronize-flags as this should be called when the
- server is actually being opened.
- (gnus-agent-possibly-synchronize-flags)
- (gnus-agent-possibly-synchronize-flags-server): Move check for the
- flags file of an agentized server to the latter function.
-
- * gnus-int.el (gnus-agent-possibly-synchronize-flags-server): Autoload.
- (gnus-open-server): Call gnus-agent-possibly-synchronize-flags-server
- after a connection has been established successfully.
-
2007-11-24 Reiner Steib <Reiner.Steib@gmx.de>
* tls.el (tls-checktrust, tls-hostmismatch, tls-untrusted): Add custom
(gnus-agent-make-mode-line-string " Plugged"
'mouse-2
'gnus-agent-toggle-plugged))
- (gnus-agent-go-online gnus-agent-go-online)
- (gnus-agent-possibly-synchronize-flags))
+ (gnus-agent-go-online gnus-agent-go-online))
(t
(gnus-agent-close-connections)
(setq gnus-plugged set-to)
(interactive)
(save-excursion
(dolist (gnus-command-method (gnus-agent-covered-methods))
- (when (and (file-exists-p (gnus-agent-lib-file "flags"))
- (eq (gnus-server-status gnus-command-method) 'ok))
+ (when (eq (gnus-server-status gnus-command-method) 'ok)
(gnus-agent-possibly-synchronize-flags-server gnus-command-method)))))
(defun gnus-agent-synchronize-flags-server (method)
(defun gnus-agent-possibly-synchronize-flags-server (method)
"Synchronize flags for server according to `gnus-agent-synchronize-flags'."
- (when (or (and gnus-agent-synchronize-flags
- (not (eq gnus-agent-synchronize-flags 'ask)))
- (and (eq gnus-agent-synchronize-flags 'ask)
- (gnus-y-or-n-p (format "Synchronize flags on server `%s'? "
- (cadr method)))))
+ (when (and (file-exists-p (gnus-agent-lib-file "flags"))
+ (or (and gnus-agent-synchronize-flags
+ (not (eq gnus-agent-synchronize-flags 'ask)))
+ (and (eq gnus-agent-synchronize-flags 'ask)
+ (gnus-y-or-n-p
+ (format "Synchronize flags on server `%s'? "
+ (cadr method))))))
(gnus-agent-synchronize-flags-server method)))
;;;###autoload
(autoload 'gnus-agent-expire "gnus-agent")
(autoload 'gnus-agent-regenerate-group "gnus-agent")
(autoload 'gnus-agent-read-servers-validate-native "gnus-agent")
+(autoload 'gnus-agent-possibly-synchronize-flags-server "gnus-agent")
(defcustom gnus-open-server-hook nil
"Hook called just before opening connection to the news server."
;; prompting with "go offline?". This is only a concern
;; when the agent's backend fails to open the server.
(gnus-open-server gnus-command-method))
+ (when (and (eq (cadr elem) 'ok) gnus-agent
+ (gnus-agent-method-p gnus-command-method))
+ (save-excursion
+ (gnus-agent-possibly-synchronize-flags-server
+ gnus-command-method)))
result)))))
(defun gnus-close-server (gnus-command-method)
;; Insert the text.
(eval gnus-server-line-format-spec))
(list 'gnus-server (intern gnus-tmp-name)
- 'gnus-named-server (intern (gnus-method-to-server method))))))
+ 'gnus-named-server (intern (gnus-method-to-server method t))))))
(defun gnus-enter-server-buffer ()
"Set up the server buffer."
(nth 1 method))))
method)))
-(defsubst gnus-method-to-server (method)
+(defsubst gnus-method-to-server (method &optional nocache)
(catch 'server-name
(setq method (or method gnus-select-method))
;; Perhaps it is already in the cache.
- (mapc (lambda (name-method)
- (if (equal (cdr name-method) method)
- (throw 'server-name (car name-method))))
- gnus-server-method-cache)
+ (unless nocache
+ (mapc (lambda (name-method)
+ (if (equal (cdr name-method) method)
+ (throw 'server-name (car name-method))))
+ gnus-server-method-cache))
(mapc
(lambda (server-alist)
;;; Agent functions
-(defun gnus-agent-method-p (method)
+(defun gnus-agent-method-p (method-or-server)
"Say whether METHOD is covered by the agent."
- (or (eq (car gnus-agent-method-p-cache) method)
- (setq gnus-agent-method-p-cache
- (cons method
- (member (if (stringp method)
- method
- (gnus-method-to-server method)) gnus-agent-covered-methods))))
+ (or (eq (car gnus-agent-method-p-cache) method-or-server)
+ (let* ((method (if (stringp method-or-server)
+ (gnus-server-to-method method-or-server)
+ method-or-server))
+ (server (gnus-method-to-server method t)))
+ (setq gnus-agent-method-p-cache
+ (cons method-or-server
+ (member server gnus-agent-covered-methods)))))
(cdr gnus-agent-method-p-cache))
(defun gnus-online (method)