;;; gnuserv.el --- Lisp interface code between Emacs and gnuserv
;; Copyright (C) 1989-1997 Free Software Foundation, Inc.
-;; Version: 3.11
+;; Version: 3.12
;; Author: Andy Norman (ange@hplb.hpl.hp.com), originally based on server.el
;; Hrvoje Niksic <hniksic@xemacs.org>
;; Maintainer: Jan Vroonhof <vroonhof@math.ethz.ch>,
(defun gnuserv-main-frame-function (type)
"Return a sensible value for the main Emacs frame."
(if (or (eq type 'x)
+ (eq type 'gtk)
(eq type 'mswindows))
(car (frame-list))
nil))
This is meant in the X sense, so it will not return frames that are on another
visual screen. Totally visible frames are preferred. If none found, return nil."
(if (or (eq type 'x)
+ (eq type 'gtk)
(eq type 'mswindows))
(cond ((car (filtered-frame-list 'frame-totally-visible-p
(selected-device))))
"Process gnuserv client requests to execute Emacs commands."
(setq gnuserv-string (concat gnuserv-string string))
;; C-d means end of request.
- (when (string-match "\C-d\\'" gnuserv-string)
- (cond ((string-match "^[0-9]+" gnuserv-string) ; client request id
+ (when (string-match "\C-d\n?\\'" gnuserv-string)
+ (cond ((string-match "\\`[0-9]+" gnuserv-string) ; client request id
(let ((header (read-from-string gnuserv-string)))
;; Set the client we are talking to.
(setq gnuserv-current-client (car header))
(signal 'quit nil)))
(setq gnuserv-string "")))
(t
- (error "%s: invalid response from gnuserv" gnuserv-string)
- (setq gnuserv-string "")))))
+ (let ((response (car (split-string gnuserv-string "\C-d"))))
+ (setq gnuserv-string "")
+ (error "%s: invalid response from gnuserv" response))))))
;; This function is somewhat of a misnomer. Actually, we write to the
;; server (using `process-send-string' to gnuserv-process), which
((null dest-frame)
(case (car type)
(tty (apply 'make-tty-device (cdr type)))
+ (gtk (make-gtk-device))
(x (make-x-device (cadr type)))
(mswindows (make-mswindows-device))
(t (error "Invalid device type"))))