]> code.delx.au - gnu-emacs/commitdiff
; * lisp/simple: Revert presumably unintentional deletion of special-mode.
authorGlenn Morris <rgm@gnu.org>
Wed, 10 Jun 2015 03:34:50 +0000 (20:34 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 10 Jun 2015 03:34:50 +0000 (20:34 -0700)
lisp/simple.el

index 9dfb3f251810dda272476913036f933da7986136..1eb0643ef6f775983c17acad1656a109927cda97 100644 (file)
@@ -353,6 +353,27 @@ Other major modes are defined by comparison with this one."
   (kill-all-local-variables)
   (run-mode-hooks))
 
+;; Special major modes to view specially formatted data rather than files.
+
+(defvar special-mode-map
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "q" 'quit-window)
+    (define-key map " " 'scroll-up-command)
+    (define-key map [?\S-\ ] 'scroll-down-command)
+    (define-key map "\C-?" 'scroll-down-command)
+    (define-key map "?" 'describe-mode)
+    (define-key map "h" 'describe-mode)
+    (define-key map ">" 'end-of-buffer)
+    (define-key map "<" 'beginning-of-buffer)
+    (define-key map "g" 'revert-buffer)
+    map))
+
+(put 'special-mode 'mode-class 'special)
+(define-derived-mode special-mode nil "Special"
+  "Parent major mode from which special major modes should inherit."
+  (setq buffer-read-only t))
+
 ;; Making and deleting lines.
 
 (defvar self-insert-uses-region-functions nil