(global-set-key "\C-x?" 'help-command) ; Map help to C-x ?
(global-set-key "\C-h" 'backward-delete-char-untabify); map Backspace to DEL

;; Options Menu Settings
;; =====================
(cond
 ((and (string-match "XEmacs" emacs-version)
       (boundp 'emacs-major-version)
       (or (and
            (= emacs-major-version 19)
            (>= emacs-minor-version 14))
           (= emacs-major-version 20))
       (fboundp 'load-options-file))
  (load-options-file "~/.xemacs-options")))
;; ============================
;; End of Options Menu Settings
;;;  -*- Mode: Emacs-Lisp -*-

;; Tabs are anachronistic.
(setq-default indent-tabs-mode nil)

;; GNU Info pages.
(setq Info-default-directory-list
   '("/usr/local/info/" "/usr/info/")) 

;; Default font for GNU Emacs 19.
;(if (not (string-match "XEmacs" emacs-version))
;  (set-default-font "6x13")
;)

;; X11 mouse and selection handling.
(if (string-match "XEmacs" emacs-version)
  (load-file (concat (getenv "HOME") "/souris.el"))
)

         ;; Common Lisp indentation.
         (load-library "cl-indent")
         (add-hook 'lisp-mode-hook
           (lambda ()
             (setq lisp-indent-function 'common-lisp-indent-function)
         ) )
         ;; Additional definitions by Pierpaolo Bernardi.
         (defun cl-indent (sym indent)
           (put sym 'common-lisp-indent-function
             (if (symbolp indent)
               (get indent 'common-lisp-indent-function)
               indent
         ) ) )
         (cl-indent 'if '1)
         (cl-indent 'defclass '((&whole 4 &rest (&whole 2 &rest 1))
                                &rest (&whole 2 &rest 1)))
         (cl-indent 'defgeneric 'defun)
         (cl-indent 'defmethod '(4 4 (&whole 4 &rest 1) &body))
         (cl-indent 'generic-flet 'flet)
         (cl-indent 'generic-labels 'labels)
         (cl-indent 'symbol-macrolet 'multiple-value-bind)
         (cl-indent 'with-accessors 'multiple-value-bind)
         (cl-indent 'with-added-methods '((1 4 ((&whole 1))) (2 &body)))
         (cl-indent 'with-slots 'multiple-value-bind)
         (cl-indent 'handler-bind '((&whole 4 &rest 1) 2 &body))
         (cl-indent 'handler-case '((1 4) (&whole 2 ((0 1) (1 3) (2 &body)))))
         (cl-indent 'define-condition '((1 6)
                                        (2 6 ((&whole 1)))
                                        (3 4 ((&whole 1)))
                                        (4 &body)))
         (cl-indent 'restart-bind '(((&whole 2 (0 1) (&whole 1))) (2 &body)))
         (cl-indent 'restart-case '((1 4) (&whole 2 ((0 1) (&whole 1)))))
         (cl-indent 'with-condition-restarts '((1 4 ((&whole 1))) (2 &body)))
         (cl-indent 'with-simple-restart '((1 4 ((&whole 1))) (2 &body)))


         ;; Visualizing Lisp forms.
         (let ((hook
                 (lambda ()
                   (setq mode-motion-hook 'mode-motion-highlight-sexp))))
           (add-hook 'emacs-lisp-mode-hook hook t)
           (add-hook 'lisp-interaction-mode-hook hook t)
           (add-hook 'lisp-mode-hook hook t)
           (add-hook 'inferior-lisp-mode-hook hook t)
           (add-hook 'talk-mode-hook hook t)
         )


         ;; XEmacs doesn't autoload inf-lisp.el, load it now.
         (load-library "inf-lisp")
         ;; Define the program to be called by M-x run-lisp.
         (setq inferior-lisp-program "clisp -I -q")
         ;; Add new keybindings: C-x C-e evaluates the *next* form,
         ;; C-x C-m macroexpands the next form.
         (defun lisp-eval-sexp (&optional and-go)
           "Send the next sexp to the inferior Lisp process.
            Prefix argument means switch to the Lisp buffer afterwards."
           (interactive "P")
           (lisp-eval-region (point)
                             (save-excursion (forward-sexp) (point))
                             and-go
         ) )
         (defun lisp-macroexpand-region (start end &optional and-go)
           "Macroexpand the current region in the inferior Lisp process.
            Prefix argument means switch to the Lisp buffer afterwards."
           (interactive "r\nP")
           (comint-send-string
            (inferior-lisp-proc)
            (format "(macroexpand-1 (quote %s))\n" (buffer-substring start end))
           )
           (if and-go (switch-to-lisp t))
         )
         (defun lisp-macroexpand-sexp (&optional and-go)
           "Macroexpand the next sexp in the inferior Lisp process.
            Prefix argument means switch to the Lisp buffer afterwards."
           (interactive "P")
           (lisp-macroexpand-region (point)
                                    (save-excursion (forward-sexp) (point))
                                    and-go
         ) )
         ;; Define the great keybindings.
         (inferior-lisp-install-letter-bindings)
         (define-key lisp-mode-map          "\C-x\C-e" 'lisp-eval-sexp)
         (define-key inferior-lisp-mode-map "\C-x\C-e" 'lisp-eval-sexp)
         (define-key lisp-mode-map          "\C-x\C-m" 'lisp-macroexpand-sexp)
         (define-key inferior-lisp-mode-map "\C-x\C-m" 'lisp-macroexpand-sexp)


         (defun clisp ()
           (interactive)
           (setq inferior-lisp-program "clisp -I -q")
           (run-lisp inferior-lisp-program))

(global-font-lock-mode 1)
(setq font-lock-maximum-decoration t)
;(add-hook 'lisp-mode-hook 'turn-on-font-lock)  ; overridden by global

(put 'downcase-region 'disabled nil)

(put 'upcase-region 'disabled nil)

(autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl programs" t)
(setq cperl-hairy t)
(setq auto-mode-alist
      (append '(("\\.[pP][Llm]$" . perl-mode))  auto-mode-alist))
(setq interpreter-mode-alist (append interpreter-mode-alist
                                 '(("miniperl" . perl-mode))))

;; User customizations below

;; bind goto-line to C-g
(global-set-key [?\C-g] 'goto-line)
;; bind repeat search to C-r
(global-set-key [?\C-r] 'isearch-repeat-forward)
