From: Juanma Barranquero Date: Mon, 21 Jan 2008 12:06:59 +0000 (+0000) Subject: (server-log-time-function): New function. X-Git-Tag: emacs-pretest-23.0.90~8479 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=88fd26a1c7be6bbc8b0ab1eb00abcfb6dafe74a1;p=emacs.git (server-log-time-function): New function. (server-log): Use it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eadbd4dedb6..db2bb83bf38 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-01-21 Juanma Barranquero + + * server.el (server-log-time-function): New function. + (server-log): Use it. + 2008-01-21 Glenn Morris * progmodes/hideif.el: Move defcustoms and defface to start of file. diff --git a/lisp/server.el b/lisp/server.el index 8e14ffa3826..2087af26b10 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -291,17 +291,20 @@ If NOFRAME is non-nil, let the frames live. (To be used from (server-log "Deleted" proc)))) +(defvar server-log-time-function 'current-time-string + "Function to generate timestamps for the *server* buffer.") + (defun server-log (string &optional client) "If a *server* buffer exists, write STRING to it for logging purposes. If CLIENT is non-nil, add a description of it to the logged message." (when (get-buffer "*server*") (with-current-buffer "*server*" (goto-char (point-max)) - (insert (current-time-string) + (insert (funcall server-log-time-function) (cond - ((null client) " ") - ((listp client) (format " %s: " (car client))) - (t (format " %s: " client))) + ((null client) " ") + ((listp client) (format " %s: " (car client))) + (t (format " %s: " client))) string) (or (bolp) (newline)))))