# HG changeset patch # User Stefan Monnier # Date 1213981833 0 # Node ID 48b2db6b4c286489b08288a15dbf20a18013d967 # Parent 7742c3c064076938df5e7f6bed9fade1532737ab (special-mode-map): New var. (special-mode): New major mode. diff -r 7742c3c06407 -r 48b2db6b4c28 etc/NEWS --- a/etc/NEWS Fri Jun 20 17:08:55 2008 +0000 +++ b/etc/NEWS Fri Jun 20 17:10:33 2008 +0000 @@ -1241,6 +1241,9 @@ * New Packages for Lisp Programming in Emacs 23.1 +** The new major mode `special-mode' is intended as a parent for +major modes such as those that set the "'mode-class 'special" property. + ** find-cmd.el can build `find' commands using lisp syntax. ** The package isearch-multi.el has been added. It implements a new mode diff -r 7742c3c06407 -r 48b2db6b4c28 lisp/ChangeLog --- a/lisp/ChangeLog Fri Jun 20 17:08:55 2008 +0000 +++ b/lisp/ChangeLog Fri Jun 20 17:10:33 2008 +0000 @@ -1,9 +1,14 @@ +2008-06-20 Stefan Monnier + + * simple.el (special-mode-map): New var. + (special-mode): New major mode. + 2008-06-20 Dan Nicolaescu * vc.el (vc-dir-hide-up-to-date): Undo previous change. (vc-switch-backend): Simplify. (Todo): Remove solved items. - + * vc-cvs.el (vc-cvs-parse-status, vc-cvs-parse-entry): Do not set the vc-backend property. @@ -14,8 +19,8 @@ 2008-06-20 Ulf Jasper - * net/newst-treeview.el (newsticker-treeview-own-frame): Changed - default value to nil. + * net/newst-treeview.el (newsticker-treeview-own-frame): + Change default value to nil. (newsticker--treeview-list-add-item) (newsticker--treeview-propertize-tag): Show item title in tooltip. diff -r 7742c3c06407 -r 48b2db6b4c28 lisp/simple.el --- a/lisp/simple.el Fri Jun 20 17:08:55 2008 +0000 +++ b/lisp/simple.el Fri Jun 20 17:10:33 2008 +0000 @@ -391,6 +391,25 @@ (unless delay-mode-hooks (run-hooks 'after-change-major-mode-hook))) +;; 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) + (define-key map "\C-?" 'scroll-down) + (define-key map "?" '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 hard-newline (propertize "\n" 'hard t 'rear-nonsticky '(hard)))