Function: server-eval-and-print
server-eval-and-print is a byte-compiled function defined in
server.el.gz.
Signature
(server-eval-and-print EXPR PROC)
Documentation
Eval EXPR and send the result back to client PROC.
Source Code
;; Defined in /usr/src/emacs/lisp/server.el.gz
(defun server-eval-and-print (expr proc)
"Eval EXPR and send the result back to client PROC."
;; While we're running asynchronously (from a process filter), it is likely
;; that the emacsclient command was run in response to a user
;; action, so the user probably knows that Emacs is processing this
;; emacsclient request, so if we get a C-g it's likely that the user
;; intended it to interrupt us rather than interrupt whatever Emacs
;; was doing before it started handling the process filter.
;; Hence `with-local-quit' (bug#6585).
(let ((v (with-local-quit (eval (car (read-from-string expr)) t))))
(when proc
(with-temp-buffer
(let ((standard-output (current-buffer)))
(pp v)
(let ((text (buffer-substring-no-properties
(point-min) (point-max))))
(server-reply-print (server-quote-arg text) proc)))))))