(defun server-eval-and-print (expr proc)
"Eval EXPR and send the result back to client PROC."
(let ((v (eval (car (read-from-string expr)))))
- (when (and v proc)
+ (when proc
(with-temp-buffer
(let ((standard-output (current-buffer)))
(pp v)
"When done with a buffer, type \\[server-edit]")))))
(when (and frame (null tty-name))
(server-unselect-display frame)))
- (error (server-return-error proc err)))))
+ ((quit error)
+ (when (eq (car err) 'quit)
+ (message "Quit emacsclient request"))
+ (server-return-error proc err)))))
(defun server-return-error (proc err)
(ignore-errors
(add-to-history 'file-name-history filen)
(if (null obuf)
(progn
- (run-hooks 'pre-command-hook)
+ (run-hooks 'pre-command-hook)
(set-buffer (find-file-noselect filen)))
(set-buffer obuf)
;; separately for each file, in sync with post-command hooks,
;; with the new buffer current:
- (run-hooks 'pre-command-hook)
+ (run-hooks 'pre-command-hook)
(cond ((file-exists-p filen)
(when (not (verify-visited-file-modtime obuf))
(revert-buffer t nil)))
(server-goto-line-column (cdr file))
(run-hooks 'server-visit-hook)
;; hooks may be specific to current buffer:
- (run-hooks 'post-command-hook))
+ (run-hooks 'post-command-hook))
(unless nowait
;; When the buffer is killed, inform the clients.
(add-hook 'kill-buffer-hook 'server-kill-buffer nil t)