Changes committed gnus/lisp (ChangeLog imap.el)

"Reiner Steib" <[email protected]>
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog imap.el

2008-01-14  Knut Anders Hatlen  <[email protected]>  (tiny change)

	* imap.el (imap-ping-server): New function.
	(imap-opened): Call imap-ping-server.


Index: ChangeLog
diff -u gnus/lisp/ChangeLog:7.1729 gnus/lisp/ChangeLog:7.1730
--- ChangeLog:7.1729	Fri Jan 11 07:47:46 2008
+++ ChangeLog	Tue Jan 15 00:11:24 2008
@@ -1,3 +1,8 @@
+2008-01-14  Knut Anders Hatlen  <[email protected]>  (tiny change)
+
+	* imap.el (imap-ping-server): New function.
+	(imap-opened): Call imap-ping-server.
+
 2008-01-11  Katsumi Yamaoka  <[email protected]>
 
 	* gnus-art.el (gnus-article-describe-bindings): New function.
Index: imap.el
diff -u gnus/lisp/imap.el:7.39 gnus/lisp/imap.el:7.40
--- imap.el:7.39	Thu Dec 20 23:32:43 2007
+++ imap.el	Tue Jan 15 00:11:23 2008
@@ -1157,7 +1157,16 @@
        (buffer-live-p buffer)
        (with-current-buffer buffer
 	 (and imap-process
-	      (memq (process-status imap-process) '(open run))))))
+	      (memq (process-status imap-process) '(open run))
+	      (imap-ping-server)))))
+
+(defun imap-ping-server (&optional buffer)
+  "Ping the imap server in BUFFER with a noop command. Return non-nil
+if the server responds, and nil if it does not respond. If BUFFER is
+nil, the current buffer is used."
+  (condition-case ()
+      (imap-ok-p (imap-send-command-wait "NOOP" buffer))
+    (error nil)))
 
 (defun imap-authenticate (&optional user passwd buffer)
   "Authenticate to server in BUFFER, using current buffer if nil.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.