(setq minibuffer-max-depth nil)
(setq line-number-mode t)
(setq column-number-mode t)
(setq default-abbrev-mode t)

;; Backups and auto-saving
(setq version-control t)        ; old version with suffix .~NUM~
(setq kept-new-versions 5)      ; limit the number of newest versions
(setq kept-old-versions 5)      ; limit the number of oldest versions
(setq dired-kept-versions 1)    ; limit the number of newest versions
(setq auto-save-interval 512)   ; autosave every 512 keyboard inputs
(setq auto-save-timeout 30)     ; autosave after 30 s idle

;; Keystroke customization (functions)
(global-set-key "\C-cc" 'compile)   ; to compile from within Emacs
(global-set-key "\M-\C-r" `query-replace-regexp) ; regexp replace

;; Highlight matching parenthesis () [] {} <> (depending on the mode)
(require `paren)

;; I use sentences.  Like this.
(setq sentence-end-double-space t)

;; Change "yes or no" prompts to "y or n" prompts.
(fset 'yes-or-no-p 'y-or-n-p)

;; Paste at point, not mouse position
(setq mouse-yank-at-point t)

;; Seems to default to `Binary', under xemacs-21.5 CVS HEAD.
;; (setq default-buffer-file-coding-system 'iso-8859-1)

;; Only spaces, please!
(setq-default indent-tabs-mode nil)
(setq default-tab-width 4)

;; The startup screen is annoying.
(setq inhibit-startup-message t)

;; Show time in status bar.
(setq european-calendar-style t)
(display-time)

;; Make minibuffer larger if there is more to see
(resize-minibuffer-mode 1)

;; move cursor one line when going past end of page
(setq scroll-step 1)

;; something else that should make scrolling nicer
(setq scroll-conservatively 1)

(iswitchb-default-keybindings)

(require 'gnus)
(require 'gnus-notify)

;; tramp lets me try remote files as if they were local.
(require 'tramp)

;; ERC, the emacs IRC client.
(require 'erc)
(setq erc-auto-query t)
(add-hook 'erc-mode-hook 'erc-add-scroll-to-bottom)

(require 'erc-stamp)
(erc-timestamp-mode 1)

(setq erc-timestamp-only-if-changed-flag nil
   erc-timestamp-format "%H:%M "
   erc-fill-prefix "      "
   erc-insert-timestamp-function
   'erc-insert-timestamp-left)

(setq erc-fill-column 72)

(require 'erc-truncate)
(defvar erc-insert-post-hook)
(add-hook 'erc-insert-post-hook
          'erc-truncate-buffer)
(setq erc-truncate-buffer-on-save t)

(setq erc-prompt ">>")
(setq erc-prompt-for-password nil)
(setq erc-prompt-interactive-input t)

(setq erc-hide-timestamps nil)
(add-hook 'erc-insert-modify-hook 'erc-fill)
(add-hook 'erc-send-modify-hook 'erc-fill)

;; Remove the line-continuing backslash from most of my buffers, so that
;; it doesn't confound URLs.  I appear to be too lazy to do this in a mapcar
;; over ERC-class buffers, which would be the right way to do it. 
(add-spec-to-specifier (glyph-property continuation-glyph 'image) [string :data ""] (get-buffer "#chat"))   
(add-spec-to-specifier (glyph-property continuation-glyph 'image) [string :data ""] (get-buffer "#cl")) 
(add-spec-to-specifier (glyph-property continuation-glyph 'image) [string :data ""] (get-buffer "*Article*")) 

;; URL catcher for ERC, written by Oliver Scholz.  Places URLs into an
;; *ERC URLS* buffer as they're sent to IRC channels.
(defvar my-erc-url-buffer "*ERC URLS*")

(defun my-scan-erc-urls ()
  (require 'erc-button)
  (save-excursion
    (let ((urls nil)
          (chann (or (erc-default-target)
                     "SERVER")))
      (goto-char (point-min))
      (while (re-search-forward erc-button-url-regexp nil t)
        (push (buffer-substring-no-properties
               (match-beginning 0)
               (match-end 0))
              urls))
      (when urls
        (with-current-buffer (get-buffer-create my-erc-url-buffer)
          (goto-char (point-max))
          (unless (eq (char-before) ?\n)
            (newline))
          (insert (mapconcat (lambda (str)
                               (format "%s: %s" chann str))
                             urls "\n")))))))

(add-hook 'erc-insert-modify-hook 'my-scan-erc-urls) 

;; Greed, a GROGGS client.
(setq load-path (cons "greed/" load-path))
(setq Info-default-directory-list
(cons "greed/" Info-default-directory-list))

(autoload 'greed "greed" "Read Groggs" t)

(load ".xemacs-faces.el")

(setq initial-scratch-message (concat "Welcome to xemacs.")) 
(setq frame-title-format (list ""
			       'invocation-name "@" 'system-name' ": %b"))

(setq global-font-lock-mode t)
(setq font-lock-mode-maximum-decoration t) 
(require 'font-lock)
