;; -*- emacs-lisp -*-
;; Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation
;; $Id: autoloads,v 1.13 1998/10/17 01:51:54 zappo Exp $

;; Fancy way of finding our current directory.  DON'T EVALUATE.  It
;; will choose the emacs install path instead of this source file.
(if (not (member (file-name-directory load-file-name) load-path))
    (setq load-path (cons (file-name-directory load-file-name) load-path)))

;;   For one user installation with multiple types of systems, just
;; add them right on in here.  Use M-ESC (or M-: after 19.29)
;; system-type to find out what your current system is.
;;   If you are installing on a per machine basis, on a network with
;; the install portion of the makefile, then use the commented line
;; below the cond, and take the cond part out completely
;;   On emacs systems before load-file-name is used, you will be
;; forced to put the path name in here by hand.
(let ((pathto (concat
	       (expand-file-name 
		(concat (file-name-directory load-file-name) ".."))
	       "/src/gtalk/")))
  (cond
;   ((string= system-type "linux")
;    (setq etalk-process-file (concat pathto "gtalk.linux")))
   ((file-exists-p (concat pathto "gtalk"))
    (setq etalk-process-file (concat pathto "gtalk")))
   (t
    (setq etalk-process-file "gtalk"))
   ))

;; You don't really need this since /usr/local/bin should be in peoples paths
;; (setq etalk-process-file "/usr/local/bin/etalk")

(if (string-match "XEmacs" emacs-version)
    (add-menu-button '("Apps") ["Etalk" etalk t ] "--")
  (let ((toolmap (lookup-key global-map [menu-bar tools])))
    (define-key-after toolmap [etalk] '("ETalk" . etalk) [calendar]))
  )

;; Autoloads needed so we don't have to load the whole thing
(autoload 'etalk "etalk" 
  "Talk to anyone on any machine through BSD talk protocol." t)
(autoload 'etalk-reply "etalk" 
  "Queries local talk daemon for name of last caller, and when that
returns, execute the etalk lisp function above." t)
(autoload 'etalk-batch "etalk" 
  "Talk to anyone on any machine through BSD talk protocol from command line." t)
(autoload 'etalk-mail "etalk" 
  "Talk to anyone on any machine through mail as connector." t)
(autoload 'etalk-ringer-on-command "etalk"
  "Turn on ringer so emacs will auto-answer talk requests" t)
(autoload 'tyrant-play-computer "tyrn-ai" 
  "Tyrant mode AI interface to limited games." t)
(autoload 'etalk-report "etalk-error" 
  "Report errors with etalk, with convenient scripts to load things into  mail." t)
(autoload 'finger "finger" 
  "Run finger on a host." t)

;; Now for some options you might want to enable for fun!

;; use font lock to fontify the *ETALK LOG* buffer.  Don't forget to
;; remove 'Etalk-Log from the hilit19 ignore list if you use hilit19
;; (add-hook etalk-log-mode-hooks 'turn-on-font-lock)
