Changes committed gnus/lisp (ChangeLog imap.el)

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

(imap-ping-server): New variable.
(imap-opened): On add extra ping if imap-ping-server is non-nil.
(imap-ping-server): Minor doc string fixes.


Index: ChangeLog
diff -u gnus/lisp/ChangeLog:7.1730 gnus/lisp/ChangeLog:7.1731
--- ChangeLog:7.1730	Tue Jan 15 00:11:24 2008
+++ ChangeLog	Tue Jan 15 00:22:44 2008
@@ -1,3 +1,9 @@
+2008-01-14  Reiner Steib  <[email protected]>
+
+	* imap.el (imap-ping-server): New variable.
+	(imap-opened): On add extra ping if imap-ping-server is non-nil.
+	(imap-ping-server): Minor doc string fixes.
+
 2008-01-14  Knut Anders Hatlen  <[email protected]>  (tiny change)
 
 	* imap.el (imap-ping-server): New function.
Index: imap.el
diff -u gnus/lisp/imap.el:7.40 gnus/lisp/imap.el:7.41
--- imap.el:7.40	Tue Jan 15 00:11:23 2008
+++ imap.el	Tue Jan 15 00:22:44 2008
@@ -1150,6 +1150,13 @@
       (when imap-stream
 	buffer))))
 
+(defcustom imap-ping-server t
+  "If non-nil, check if IMAP is open.
+See the function `imap-ping-server'."
+  :version "23.0" ;; No Gnus
+  :group 'imap
+  :type 'boolean)
+
 (defun imap-opened (&optional buffer)
   "Return non-nil if connection to imap server in BUFFER is open.
 If BUFFER is nil then the current buffer is used."
@@ -1158,12 +1165,14 @@
        (with-current-buffer buffer
 	 (and imap-process
 	      (memq (process-status imap-process) '(open run))
-	      (imap-ping-server)))))
+	      (if imap-ping-server
+		  (imap-ping-server)
+		t)))))
 
 (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."
+  "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)))
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.