comparison lisp/packages/gnuserv.el @ 78:c7528f8e288d r20-0b34

Import from CVS: tag r20-0b34
author cvs
date Mon, 13 Aug 2007 09:05:42 +0200
parents 131b0175ea99
children 360340f9fd5f
comparison
equal deleted inserted replaced
77:6cb4f478e7bc 78:c7528f8e288d
64 64
65 (if (and (boundp 'server-buffer-clients) 65 (if (and (boundp 'server-buffer-clients)
66 (not (featurep 'gnuserv))) 66 (not (featurep 'gnuserv)))
67 (error "Can't run gnuserv because server.el appears to be loaded already")) 67 (error "Can't run gnuserv because server.el appears to be loaded already"))
68 68
69 ;;;###autoload
69 (defvar gnuserv-frame nil 70 (defvar gnuserv-frame nil
70 "*If non-nil, the frame to be used to display all edited files. 71 "*If non-nil, the frame to be used to display all edited files.
71 If nil, then a new frame is created for each file edited. 72 If nil, then a new frame is created for each file edited.
72 This variable has no effect in XEmacs versions older than 19.9.") 73 This variable has no effect in XEmacs versions older than 19.9.")
73 74
81 (defvar server-process nil 82 (defvar server-process nil
82 "The current server process") 83 "The current server process")
83 84
84 (defvar server-string "" 85 (defvar server-string ""
85 "The last input string from the server") 86 "The last input string from the server")
87
88 (defvar server-kill-last-frame nil
89 "set to t to kill last frame")
86 90
87 (defvar current-client nil 91 (defvar current-client nil
88 "The client we are currently talking to") 92 "The client we are currently talking to")
89 93
90 (defvar server-clients nil 94 (defvar server-clients nil
485 If a server buffer is current, it is marked \"done\" and optionally saved. 489 If a server buffer is current, it is marked \"done\" and optionally saved.
486 MH <draft> files are always saved and backed up, no questions asked. 490 MH <draft> files are always saved and backed up, no questions asked.
487 When all of a client's buffers are marked as \"done\", the client is notified. 491 When all of a client's buffers are marked as \"done\", the client is notified.
488 492
489 If invoked with a prefix argument, or if there is no server process running, 493 If invoked with a prefix argument, or if there is no server process running,
490 starts server process and that is all. Invoked by \\[server-edit]." 494 starts server process and that is all. Invoked by \\[server-edit].
495
496 If `server-kill-last-frame' is t, then the final frame will be killed."
491 (interactive "P") 497 (interactive "P")
492 (if (or arg 498 (if (or arg
493 (not server-process) 499 (not server-process)
494 (memq (process-status server-process) '(signal exit))) 500 (memq (process-status server-process) '(signal exit)))
495 (server-start nil) 501 (server-start nil)
498 (cond ((fboundp 'console-type) ;; XEmacs 19.14+ 504 (cond ((fboundp 'console-type) ;; XEmacs 19.14+
499 (or (and (equal (console-type) 'x) 505 (or (and (equal (console-type) 'x)
500 gnuserv-frame 506 gnuserv-frame
501 (frame-live-p gnuserv-frame)) 507 (frame-live-p gnuserv-frame))
502 (condition-case () 508 (condition-case ()
503 (delete-frame (selected-frame) nil) 509 (delete-frame (selected-frame)
510 server-kill-last-frame)
504 (error 511 (error
505 (message "Not deleting last visible frame..."))))) 512 (message "Not deleting last visible frame...")))))
506 ((or (not window-system) 513 ((or (not window-system)
507 (and gnuserv-frame 514 (and gnuserv-frame
508 (or (and (fboundp 'frame-live-p) 515 (or (and (fboundp 'frame-live-p)
539 546
540 (global-set-key "\C-x#" 'server-edit) 547 (global-set-key "\C-x#" 'server-edit)
541 548
542 (provide 'gnuserv) 549 (provide 'gnuserv)
543 550
551 ;;; gnuserv.el ends here