From: Stefan Monnier Date: Fri, 20 Jun 2008 17:10:33 +0000 (+0000) Subject: (special-mode-map): New var. X-Git-Tag: emacs-pretest-23.0.90~4636 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d445b3f8635b2f78990e016bc610337298307556;p=emacs.git (special-mode-map): New var. (special-mode): New major mode. --- diff --git a/etc/NEWS b/etc/NEWS index d86373e3d72..eaaf924e55a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1241,6 +1241,9 @@ forms to subroutines. * 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 --git a/lisp/ChangeLog b/lisp/ChangeLog index 1a8ebbf337f..826390127a6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --git a/lisp/simple.el b/lisp/simple.el index 8367ae9ba10..20165ea7f33 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -391,6 +391,25 @@ Other major modes are defined by comparison with this one." (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)))