;
;  site-init.el
;  taken from /mit/emacs19/install/lib/emacs/19.*/lisp
;  modified for linux
;  modified for keeping emacs19 locally rather than in the emacs19 locker
;

(setq news-inews-program "/afs/sipb.mit.edu/project/sipb/bin/inews"
      gnus-default-nntp-server "news.mit.edu"
      gnus-local-domain "mit.edu"
      gnus-local-organization "Massachusetts Institute of Technology"
      mh-progs "/usr/athena/bin/"
      mh-lib "/usr/athena/etc/"
      manual-program (if (file-exists-p "/usr/athena/bin/man")
			 "/usr/athena/bin/man" "man"))

(setq load-path (cons "/usr/athena/lib/elisp" load-path))

(autoload 'discuss "discuss" "Emacs Discuss" t)

(setq require-final-newline t
      inhibit-local-variables t
      rmail-primary-inbox-list '("~/mbox" "/usr/spool/mail/$USER" "po:$USER"))

;  since this is not being run out of the emacs19 locker,
;  should this be commented out?
;  probably...

(autoload 'report-emacs-bug "emacsbug"
	  "Report a bug in Gnu emacs."
	  t)

(setq bug-gnu-emacs "emacsdev@athena.mit.edu")

(autoload 'clu-mode "clu-mode"
	  "Load CLU mode."
	  t)

(setq auto-mode-alist (append auto-mode-alist '(("\\.clu$" . clu-mode))))

(autoload 'ispell-word "ispell"
	  "Check the spelling of a word in the buffer."
	  t)
(autoload 'ispell-region "ispell"
	  "Check the spelling of a region in the buffer."
	  t)
(autoload 'ispell-buffer "ispell"
	  "Check the spelling of the entire buffer."
	  t)

; Athena auto-save customizations

(defconst auto-save-main-directory
  "/usr/tmp/"
  "The root of the auto-save directory; nil means use old style.")

(defun make-auto-save-file-name ()
  "Return file name to use for auto-saves of current buffer.
Does not consider auto-save-visited-file-name; that is checked
before calling this function.
You can redefine this for customization.
See also auto-save-file-name-p."
  (if auto-save-main-directory
      (if buffer-file-name
	  (concat auto-save-main-directory
		  "#"
		  (user-real-uid)
		  "."
		  (auto-save-replace-slashes buffer-file-name)
		  "#")
	(concat auto-save-main-directory
		"#%"
		(user-real-uid)
		"."
		(auto-save-replace-slashes (buffer-name))
		"#"))
    (if buffer-file-name
	(concat (file-name-directory buffer-file-name)
		"#"
		(file-name-nondirectory buffer-file-name)
		"#")
      (expand-file-name (concat "#%" (buffer-name) "#")))))

(defun auto-save-replace-slashes (name)
  "Replace all slashes in NAME with bangs."
  (let ((pos 0) (len (length name)))
    (setq ourname (make-string len ? ))
    (while (< pos len)
      (if (= (aref name pos) ?/)
	  (aset ourname pos ?@)
	(aset ourname pos (aref name pos)))
      (setq pos (+ 1 pos)))
    ourname))

;  end of emacs19 site-init.el

;  this fixes a bug in slackware emacs setup, and is not needed for
;  other distributions of emacs.
(setq sendmail-program "/usr/lib/sendmail")
