]> git.eshelyaron.com Git - emacs.git/commitdiff
lisp/gnus/gnus-int.el (gnus-backend-trace): Honour gnus-backend-trace
authorChristopher Schmidt <christopher@ch.ristopher.com>
Wed, 30 Jan 2013 22:45:32 +0000 (22:45 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 30 Jan 2013 22:45:32 +0000 (22:45 +0000)
lisp/gnus/ChangeLog
lisp/gnus/gnus-int.el

index ebfc31fd91d608313ca95088b1fa78c32660c801..7cb278f2a6f0b3ba63b08a1ca00081f318653a87 100644 (file)
@@ -1,5 +1,8 @@
 2013-01-30  Christopher Schmidt  <christopher@ch.ristopher.com>
 
+       * gnus-int.el (gnus-backend-trace-elapsed): New variable.
+       (gnus-backend-trace): Honour gnus-backend-trace.
+
        * mml.el (mml-insert-part): Insert closing tag.
 
        * mm-decode.el (mm-save-part): Handle invalid read-file-name results.
index 81e0252cf9337affda6e6bc8e71bf17ea8ff4c1d..2378b598eeb6d5790615997203986380c93b54c5 100644 (file)
@@ -248,18 +248,20 @@ If it is down, start it up (again)."
       'denied))
 
 (defvar gnus-backend-trace nil)
+(defvar gnus-backend-trace-elapsed nil)
 
 (defun gnus-backend-trace (type form)
-  (with-current-buffer (get-buffer-create "*gnus trace*")
-    (buffer-disable-undo)
-    (goto-char (point-max))
-    (insert (format-time-string "%H:%M:%S")
-           (format " %.2fs %s %S\n"
-                   (if (numberp gnus-backend-trace)
-                       (- (float-time) gnus-backend-trace)
-                     0)
-                   type form))
-    (setq gnus-backend-trace (float-time))))
+  (when gnus-backend-trace
+    (with-current-buffer (get-buffer-create "*gnus trace*")
+      (buffer-disable-undo)
+      (goto-char (point-max))
+      (insert (format-time-string "%H:%M:%S")
+             (format " %.2fs %s %S\n"
+                     (if (numberp gnus-backend-trace-elapsed)
+                         (- (float-time) gnus-backend-trace-elapsed)
+                       0)
+                     type form))
+      (setq gnus-backend-trace-elapsed (float-time)))))
 
 (defun gnus-open-server (gnus-command-method)
   "Open a connection to GNUS-COMMAND-METHOD."