;; 
;; /etc/xemacs21/site-start.d/50aplus-fsf-el.el
;;
;; Copyright (C) 2002, Neil Roeth <neil@debian.org>

(let ((aplus-fsf-el-pkgdir (concat "/usr/share/"
				   (symbol-name debian-emacs-flavor)
				   "/site-lisp/aplus-fsf-el")))
 (if (file-exists-p aplus-fsf-el-pkgdir)
     (progn
       (debian-pkg-add-load-path-item aplus-fsf-el-pkgdir)

       ;; Following to override setting in aplus.el since load-path is
       ;; properly set here on Debian systems
       (defvar aplus-set-load-path nil)

       ;; Pressing F4 will load A+ then start A+ in a new process buffer.
       (autoload 'a-other-window "aplus"
	 "Start A+ interpreter in an A+ process buffer")
       (define-key global-map [f4] `a-other-window)

       ;; Loading an A+ file will load A+.
       (autoload 'a-minor-mode "aplus"
	 "Minor mode for editing A+ code." t)
       (defun change-assoc (key value alist)
	 "usage: (change-assoc KEY VALUE ALIST)
If ALIST contains KEY then replace the associated value with VALUE.
Otherwise, associate KEY and VALUE in the alist"
	 (let ((tuple (assoc key alist)))
	   (cond (tuple (setcdr tuple value))
		 (t (nconc alist (list (cons key value)))))))
       (change-assoc "\\.apl$" 'a-minor-mode auto-mode-alist)
       (change-assoc "\\.a$" 'a-minor-mode auto-mode-alist)
       (change-assoc "\\.\\+$" 'a-minor-mode auto-mode-alist)
)))
