;;; -*- Mode: Lisp; Package: EDITOR -*-
;;;
;;; This file is part of xyzzy.
;;;

;;[2006-06-07]23:34:06(+0900)

(provide "viewmode")

(in-package "editor")

(export '(*view-mode-hook*
	  *view-mode-map*
	  view-mode))

;;(defvar-local *ex-mode* nil)
(defvar *view-mode-hook* nil)

(defvar *view-mode-map* nil)
(unless *view-mode-map*
  (setq *view-mode-map* (make-sparse-keymap))
  (define-key *view-mode-map* #\SPC 'next-page)
  (set-extended-key-translate-table exkey-S-space #\S-F20)
  (define-key *view-mode-map* #\S-F20 'previous-page)
  (define-key *view-mode-map* #\C-h 'previous-page))

(defun view-mode ()
  (interactive)
  (kill-all-local-variables)
  (setq buffer-mode 'view-mode)
  (setq mode-name "View")
  (use-keymap *view-mode-map*)
  (use-syntax-table *text-mode-syntax-table*)
  (setq buffer-read-only t)
  (run-hooks '*view-mode-hook*))
