comparison lisp/packages/gnuserv.el @ 12:bcdc7deadc19 r19-15b7

Import from CVS: tag r19-15b7
author cvs
date Mon, 13 Aug 2007 08:48:16 +0200
parents ac2d302a0011
children ec9a17fef872
comparison
equal deleted inserted replaced
11:91ffe8bd52e4 12:bcdc7deadc19
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
488 If a server buffer is current, it is marked \"done\" and optionally saved. 492 If a server buffer is current, it is marked \"done\" and optionally saved.
489 MH <draft> files are always saved and backed up, no questions asked. 493 MH <draft> files are always saved and backed up, no questions asked.
490 When all of a client's buffers are marked as \"done\", the client is notified. 494 When all of a client's buffers are marked as \"done\", the client is notified.
491 495
492 If invoked with a prefix argument, or if there is no server process running, 496 If invoked with a prefix argument, or if there is no server process running,
493 starts server process and that is all. Invoked by \\[server-edit]." 497 starts server process and that is all. Invoked by \\[server-edit].
498
499 If `server-kill-last-frame' is t, then the final frame will be killed."
494 (interactive "P") 500 (interactive "P")
495 (if (or arg 501 (if (or arg
496 (not server-process) 502 (not server-process)
497 (memq (process-status server-process) '(signal exit))) 503 (memq (process-status server-process) '(signal exit)))
498 (server-start nil) 504 (server-start nil)
501 (cond ((fboundp 'console-type) ;; XEmacs 19.14+ 507 (cond ((fboundp 'console-type) ;; XEmacs 19.14+
502 (or (and (equal (console-type) 'x) 508 (or (and (equal (console-type) 'x)
503 gnuserv-frame 509 gnuserv-frame
504 (frame-live-p gnuserv-frame)) 510 (frame-live-p gnuserv-frame))
505 (condition-case () 511 (condition-case ()
506 (delete-frame (selected-frame) nil) 512 (delete-frame (selected-frame)
513 server-kill-last-frame)
507 (error 514 (error
508 (message "Not deleting last visible frame..."))))) 515 (message "Not deleting last visible frame...")))))
509 ((or (not window-system) 516 ((or (not window-system)
510 (and gnuserv-frame 517 (and gnuserv-frame
511 (or (and (fboundp 'frame-live-p) 518 (or (and (fboundp 'frame-live-p)
542 549
543 (global-set-key "\C-x#" 'server-edit) 550 (global-set-key "\C-x#" 'server-edit)
544 551
545 (provide 'gnuserv) 552 (provide 'gnuserv)
546 553
554 ;;; gnuserv.el ends here