;;;
;;; Emacs 19 server specific code.
;;;
;;; ----------------------------------------------------------------------
;;; This file is part of ILOG Talk.
;;; Inquiries to ILOG S.A.
;;;              9 rue de Verdun, BP 85,
;;;              94253 Gentilly Cedex, France.
;;;
;;; Copyright (c) 1993-1996 by ILOG
;;; ----------------------------------------------------------------------
;;;

;; Setup
;; -----
;;

(defun tsp:emacs-server-specific-variables ()
  ())

(if lucid-emacs-p
    (defun ts:clean-output-specific (str)
      "In Lucid emacs, when a \n (10) is outputed by a process, a ^M (13) is
automatically inserted before. This makes newlines in messages sent to
emacs doesn't work. So we must clean the string. Theoretically, we should
remove only ^M's which precede a \n, but since a ^M\n sequence can be
splitted when given to the process filter, we just remove all the ^M's. This 
means that Talk should never intentionally send ^M's, since they will be
removed."
      (let ((start 0))
	(while (setq start (string-match "
" str start))
	  (setq str (concat (substring str 0 start)
			    (substring str (1+ start)))))
	str))
  (defun ts:clean-output-specific (str)
    str))


;; Menus
;; -----
;;

(tm:add-menus
 ("Compilation"
  ("Analyze" "\C-c\C-a")
  ("Analyze & Build" "\C-c\C-b")
  ("Load" "\C-c\C-l")
  t
  ("Update Analyze" "\C-c\C-u\C-a")
  ("Update Analyze & Build" "\C-c\C-u\C-b")
  ("Update Load" "\C-c\C-u\C-l")
  t
  ("In workspace" "\C-c\C-w")
  t
  ("Current error" ts:error-site-current 
   (tm:last-work-prunit-signal-action t))
  ("Next error" ts:error-site-next 
   (tm:last-work-prunit-signal-action t))
  ("Previous error" ts:error-site-previous 
   (tm:last-work-prunit-signal-action t))
  ("Edit *Errors*" ts:edit-error-sites
   (tm:last-work-prunit-signal-action t))
  t
  ("Edit *Modules*" ts:edit-prunit-group))
 ("Debug"
  ("Load interpreted" "\C-c\C-i")
  ("Run test" "\C-c\C-t")
  t
  ("Eval s-exp" "\C-c\C-e")
  ("Macroexpand s-exp" "\C-c\C-m")
  t
  ("Set breakpoint" "\C-c/")
  ("Clear breakpoint" "\C-c\C-d")
  ("Edit *Breakpoints*" ts:edit-breakpoint-sites))
 ("Process"
  ("Process buffer" ts:switch-text-server)
  ("Send interrupt" "\C-c\C-c")
  ("Kill process" "\C-\\")
  t
  ("Previous command" ("\M-p" tpp:previous-command))
  ("Next command" ("\M-n" tpp:next-command))
  ("I-search backward" ("\M-r" tpp:isearch-history-backward))
  ("I-search forward" ("\M-s" tpp:isearch-history-forward))))
  

(provide 'talk-server19)
