From 5f9eccc4b6eb6d6a5fcf16b9ec3ee4d331c468cb Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Wed, 30 Jan 2013 22:45:32 +0000 Subject: [PATCH] lisp/gnus/gnus-int.el (gnus-backend-trace): Honour gnus-backend-trace --- lisp/gnus/ChangeLog | 3 +++ lisp/gnus/gnus-int.el | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index ebfc31fd91d..7cb278f2a6f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,8 @@ 2013-01-30 Christopher Schmidt + * 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. diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 81e0252cf93..2378b598eeb 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -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." -- 2.39.2