aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/server.el11
2 files changed, 12 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eadbd4dedb6..db2bb83bf38 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-01-21 Juanma Barranquero <lekktu@gmail.com>
2
3 * server.el (server-log-time-function): New function.
4 (server-log): Use it.
5
12008-01-21 Glenn Morris <rgm@gnu.org> 62008-01-21 Glenn Morris <rgm@gnu.org>
2 7
3 * progmodes/hideif.el: Move defcustoms and defface to start of file. 8 * 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
291 291
292 (server-log "Deleted" proc)))) 292 (server-log "Deleted" proc))))
293 293
294(defvar server-log-time-function 'current-time-string
295 "Function to generate timestamps for the *server* buffer.")
296
294(defun server-log (string &optional client) 297(defun server-log (string &optional client)
295 "If a *server* buffer exists, write STRING to it for logging purposes. 298 "If a *server* buffer exists, write STRING to it for logging purposes.
296If CLIENT is non-nil, add a description of it to the logged message." 299If CLIENT is non-nil, add a description of it to the logged message."
297 (when (get-buffer "*server*") 300 (when (get-buffer "*server*")
298 (with-current-buffer "*server*" 301 (with-current-buffer "*server*"
299 (goto-char (point-max)) 302 (goto-char (point-max))
300 (insert (current-time-string) 303 (insert (funcall server-log-time-function)
301 (cond 304 (cond
302 ((null client) " ") 305 ((null client) " ")
303 ((listp client) (format " %s: " (car client))) 306 ((listp client) (format " %s: " (car client)))
304 (t (format " %s: " client))) 307 (t (format " %s: " client)))
305 string) 308 string)
306 (or (bolp) (newline))))) 309 (or (bolp) (newline)))))
307 310