1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-01 11:14:55 +00:00

(server-log-time-function): New function.

(server-log): Use it.
This commit is contained in:
Juanma Barranquero 2008-01-21 12:06:59 +00:00
parent a1e8139657
commit 88fd26a1c7
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2008-01-21 Juanma Barranquero <lekktu@gmail.com>
* server.el (server-log-time-function): New function.
(server-log): Use it.
2008-01-21 Glenn Morris <rgm@gnu.org>
* progmodes/hideif.el: Move defcustoms and defface to start of file.

View File

@ -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)))))