;; $Id: dot_emacs,v 1.2 2000/03/29 19:12:16 nwalsh Exp 
;; DocBook IDE mode
(autoload 'docbook-mode "docbookide" "Major mode for DocBook documents." t)
;; Turn on font lock when in DocBook mode
(add-hook 'docbook-mode-hook
	  'turn-on-font-lock)

;; You might want to make this the default for .sgml or .xml documents,
;; or you might want to rely on -*- DocBook -*- on the first line,
;; or perhaps buffer variables. It's up to you...
;;(setq auto-mode-alist
;;      (append
;;       (list
;;	'("\\.sgm" . docbook-mode))
;;	'("\\.sgml" . docbook-mode))
;;	'("\\.xml" . docbook-mode))
;;       auto-mode-alist))

;; keyboard mods not specific to any mode.
(global-set-key [(control h)] 'delete-backward-char) ;backspace, not help!
(global-set-key "\C-cg" 'goto-line)
(global-set-key [home] 'beginning-of-line)    ;not screen
(global-set-key "\e[1~" 'beginning-of-line)   ;not screen
(global-set-key "\eOH" 'beginning-of-line)    ;Needed on remote xterm?
(global-set-key [end] 'end-of-line)           ;inactive by default?
(global-set-key "\e[4~" 'end-of-line)
(global-set-key "\eOF" 'end-of-line)          ;Needed on remote xterm?

(global-set-key [delete] 'delete-char)    ; delete char, don't move cursor.
(global-set-key [(meta control h)] 'backward-kill-word)
(global-set-key [f2] 'other-window)       ;convenient shortcuts.
(global-set-key [f3] 'kill-this-buffer)
(global-unset-key [escape escape])   ;eval-expr gets in my way.

(global-set-key [(control x)(control u)] 'undo)  ;bind to something useful.
;(require 'redo)
;(global-set-key [(control x)(control r)] 'redo) ;consistent with my undo.

(global-set-key [(shift button2)]               ;<shift>-mouse2 to load
                'browse-url-at-mouse)     ;url at point into netscape.

;; Make sure we have sgml and xml modes (psgml.el)
(autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t)
(autoload 'xml-mode "psgml" "Major mode to edit XML files." t)
(setq sgml-set-face t)
(setq sgml-indent-step t)
(setq sgml-live-element-indicator t)
;; Recognize Lutris Enhydra doml files as xml.  This doesn't work
;; very well because xml-mode has problems reading the doml dtd.
(setq auto-mode-alist (cons '("\\.doml$" . xml-mode) auto-mode-alist))

;; Set the global central catalog
(setq sgml-catalog-files (quote ("CATALOG" "/etc/sgml/catalog")))
