[gnus git] branch master updated: n0-17-330-gc52fcc4 =1= Don't message so much when reading nnimap stuff.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  c52fcc4a0c585ea3770843f80579ad5a00dab7e8 (commit)
      from  0e020afe803eb52571796eea4850e4a8dc33ac29 (commit)


- Log -----------------------------------------------------------------
commit c52fcc4a0c585ea3770843f80579ad5a00dab7e8
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Mon Sep 26 23:21:42 2011 +0200

    Don't message so much when reading nnimap stuff.
    
    * nnheader.el (nnheader-message-maybe): New function.
    
    * nnimap.el (nnimap-wait-for-response): Message less (bug#9540).

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f285bd1..45911bd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
 2011-09-26  Lars Magne Ingebrigtsen  <[email protected]>
 
+	* nnimap.el (nnimap-wait-for-response): Message less (bug#9540).
+
+	* nnheader.el (nnheader-message-maybe): New function.
+
 	* shr.el (shr-tag-table): Render totally broken tables better.
 
 	* mml.el (mml-generate-mime-1): Don't alter the contents if we're
diff --git a/lisp/nnheader.el b/lisp/nnheader.el
index 6f871cc..a8e8e7d 100644
--- a/lisp/nnheader.el
+++ b/lisp/nnheader.el
@@ -1112,6 +1112,13 @@ See `find-file-noselect' for the arguments."
 		       '(buffer-string)))))
        (insert-buffer-substring ,buffer ,start ,end))))
 
+(defvar nnheader-last-message-time '(0 0))
+(defun nnheader-message-maybe (&rest args)
+  (let ((now (current-time)))
+    (when (> (float-time (time-subtract now nnheader-last-message-time)) 1)
+      (setq nnheader-last-message-time now)
+      (apply 'nnheader-message args))))
+
 (when (featurep 'xemacs)
   (require 'nnheaderxm))
 
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index f0d3e9f..49cceaa 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -1723,7 +1723,8 @@ textual parts.")
 				      (looking-at "\\*"))))
 			(not (looking-at (format "%d .*\n" sequence)))))
 	    (when messagep
-	      (nnheader-message 7 "nnimap read %dk" (/ (buffer-size) 1000)))
+	      (nnheader-message-maybe
+	       7 "nnimap read %dk" (/ (buffer-size) 1000)))
 	    (nnheader-accept-process-output process)
 	    (goto-char (point-max)))
           openp)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog   |    4 ++++
 lisp/nnheader.el |    7 +++++++
 lisp/nnimap.el   |    3 ++-
 3 files changed, 13 insertions(+), 1 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
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.