X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgnuserv.el;h=206ef24da043321f392f2d2735d99f74c4d8ca72;hb=84d69cedb1497fde83814a796ebe5d93e168c78b;hp=01128a97d675636f895fd186439054dbd6628aff;hpb=3198ed8319f99e19a14447745f4f93e4b4522961;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/gnuserv.el b/lisp/gnuserv.el index 01128a9..206ef24 100644 --- a/lisp/gnuserv.el +++ b/lisp/gnuserv.el @@ -89,6 +89,14 @@ :group 'processes :group 'terminals) +;;;###autoload +(defcustom gnuserv-mode-line-string " Server" + "*String to display in the modeline when Gnuserv is active. +Set this to nil if you don't want a modeline indicator." +:type '(choice string + (const :tag "none" nil)) +:group 'gnuserv) + ;; Provide the old variables as aliases, to avoid breaking .emacs ;; files. However, they are obsolete and should be converted to the @@ -261,9 +269,10 @@ Each element is a gnuclient structure that identifies a client.") ;; We want the client-infested buffers to have some modeline ;; identification, so we'll make a "minor mode". (defvar gnuserv-minor-mode nil) -(make-variable-buffer-local 'gnuserv-mode) -(pushnew '(gnuserv-minor-mode " Server") minor-mode-alist - :test 'equal) +(make-variable-buffer-local 'gnuserv-minor-mode) +;;(pushnew '(gnuserv-minor-mode "Server") minor-mode-alist +;; :test 'equal) +(add-minor-mode 'gnuserv-minor-mode 'gnuserv-mode-line-string) ;; Sample gnuserv-frame functions @@ -271,6 +280,7 @@ Each element is a gnuclient structure that identifies a client.") (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)) @@ -280,6 +290,7 @@ Each element is a gnuclient structure that identifies a client.") 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)))) @@ -397,6 +408,13 @@ This order is important as not to keep the client waiting." (eval form)) + +(defun make-x-device-with-gtk-fallback (device) + (or (condition-case () + (make-x-device device) + (error nil)) + (make-gtk-device))) + ;; "Execute" a client connection, called by gnuclient. This is the ;; backbone of gnuserv.el. (defun gnuserv-edit-files (type list &rest flags) @@ -428,7 +446,8 @@ If a flag is `view', view the files read-only." ((null dest-frame) (case (car type) (tty (apply 'make-tty-device (cdr type))) - (x (make-x-device (cadr type))) + (gtk (make-gtk-device)) + (x (make-x-device-with-gtk-fallback (cadr type))) (mswindows (make-mswindows-device)) (t (error "Invalid device type")))) (t