;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;;
;; EHTS was designed and implemented by:
;;
;;	Uffe Kock Wiil 		(kock@iesd.auc.dk)
;;	Claus Bo Nielsen 	(cbn@cci.dk)
;;
;; at The University of Aalborg in Denmark spring 1990, and is provided
;; for unrestricted use provided that this legend is included on all
;; tape media and as a part of the software program in whole or part.
;; Users may copy or modify EHTS without charge, but are not authorized
;; to license or distribute it to anyone else except as part of a
;; product or program developed by the user.
;;   
;; EHTS IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
;; WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
;; PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE
;; PRACTICE.
;; 
;; EHTS is provided with no support and without any obligation on the
;; part of the authors, to assist in its use, correction, modification
;; or enhancement.
;; 
;; THE AUTHORS SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT
;; OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY EHTS OR ANY PART
;; THEREOF.
;; 
;; In no event will the authors and/or The University of Aalborg be
;; liable for any lost revenue or profits or other special, indirect and
;; consequential damages, even if the authors and/or The University of
;; Aalborg has been advised of the possibility of such damages.
;; 
;; Please address all correspondence to:
;; 
;; Uffe Kock Wiil
;; Department of Computer Science,
;; The University of Aalborg,      Email:  kock@iesd.auc.dk
;; Fredrik Bajers Vej 7E,          Phone:  + 45 98 15 42 11 (Ext 5051)
;; DK-9220 Aalborg, Denmark.       Fax:    + 45 98 15 81 29
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defvar epoch::version nil)     ;; in epoch this will not set!

;; running-epoch is a better name for the variable that tells us if we are
;; in epoch or not

(setq running-epoch epoch::version)

;; If running epoch load the special things for epoch

(if running-epoch
    (progn
      (load "sun-init")
      (setq sun-esc-bracket t)
      ;;(load "/home/dist/lib/emacs/lisp/term/sun.el")
      ;;(load "sun-mouse.elc")
      ;;(load "sun-fns.elc")
      ;;(load "sun-cursors.el")
      (load "/user/kock/Emacs/Lib-Epoch/mouse.el")
      ;; (setq auto-raise-screen nil)
      ))

;; because I have so many screens open all the time, and idle C-xC-c can
;; really screw things up for me.  So make sure we dont exit without
;; confirmation, and rebind C-xC-c appropriately

(defun my-exit-from-emacs ()
  (interactive)
  (if (yes-or-no-p "Do you want to exit ")
      (save-buffers-kill-emacs)))

(global-set-key "\C-x\C-c" 'my-exit-from-emacs)

;; My things 

(setq include-system-name nil)		; no "@machine-name"

; I like this more than "\C-z 4 \C-f"

(global-set-key "\C-z\C-f" 'find-file-other-screen) 

(setq epoch::global-update 'yes)	; set update in all buffers

(epoch::cursor-glyph 22)

(load "EHTS.el" nil t)

;;; modifies epoch-lisp/mouse.el  
;;; Patch to make mouse move problem go away??  
(defun mouse::set-point (arg)
  "Select Epoch window mouse is on, and move point to mouse position."
  (select-screen (nth 3 arg))
  (select-window (nth 2 arg))
  (goto-char (car arg)) 
  (redisplay-screen)		;workaround 'hanging redisplay bug'
  ;; traces bug when previous line commented, point moves, cursor stays
  ;;(message "%s %s %s %s" arg (point) (query-mouse) (query-cursor))
)
