summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Maus <dmaus@ictsoc.de>2011-09-18 10:35:50 +0200
committerDavid Maus <dmaus@ictsoc.de>2011-09-18 10:35:50 +0200
commitee957745db70c16aefbcaf12962aed0c1e2981f1 (patch)
treeb5b4f3f66d770878a2baca3c706e83ef5698255d
parent1b11c7e6a047b5a24cb700282c367cdd8b9a620a (diff)
downloadorg-mode-ee957745db70c16aefbcaf12962aed0c1e2981f1.tar.gz
Conditionally define `special-mode' for Emacs22
* org-test.el: Conditionally define `special-mode' for Emacs22. Copied definition from Emacs23's simple.el.
-rw-r--r--testing/org-test.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/org-test.el b/testing/org-test.el
index 728233e..32f52f6 100644
--- a/testing/org-test.el
+++ b/testing/org-test.el
@@ -4,10 +4,14 @@
;; Authors:
;; Sebastian Rose, Hannover, Germany, sebastian_rose gmx de
;; Eric Schulte, Santa Fe, New Mexico, USA, schulte.eric gmail com
+;; David Maus, Brunswick, Germany, dmaus ictsoc de
;; Released under the GNU General Public License version 3
;; see: http://www.gnu.org/licenses/gpl-3.0.html
+;; Definition of `special-mode' copied from Emacs23's simple.el to be
+;; provide a testing environment for Emacs22.
+
;;;; Comments:
;; Interactive testing for Org mode.
@@ -41,6 +45,25 @@
(expand-file-name "jump" org-test-dir)
load-path))))
(require 'cl)
+ (when (= emacs-major-version 22)
+ (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 "h" 'describe-mode)
+ (define-key map ">" 'end-of-buffer)
+ (define-key map "<" 'beginning-of-buffer)
+ (define-key map "g" 'revert-buffer)
+ (define-key map "z" 'kill-this-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)))
(require 'ert)
(require 'ert-x)
(when (file-exists-p