Mercurial > hg > xemacs-beta
diff lisp/emulators/crisp.el @ 48:56c54cf7c5b6 r19-16b90
Import from CVS: tag r19-16b90
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:56:04 +0200 |
parents | b82b59fe008d |
children |
line wrap: on
line diff
--- a/lisp/emulators/crisp.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/emulators/crisp.el Mon Aug 13 08:56:04 2007 +0200 @@ -1,7 +1,7 @@ -;; @(#) crisp.el -- Crisp/Brief Emacs emulator +;; @(#) crisp.el -- CRiSP/Brief Emacs emulator ;; Author: Gary D. Foster <Gary.Foster@corp.sun.com> -;; $Revision: 1.1.1.1 $ +;; $Revision: 1.2 $ ;; Keywords: emulations brief crisp ;; This file is part of GNU Emacs. @@ -21,6 +21,8 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;; CRiSP is a registered trademark of Foxtrot Systems Ltd. + ;;; Commentary: ;; Keybindings and minor functions to duplicate the functionality and @@ -53,42 +55,45 @@ ;; local variables (defvar crisp-mode-map (copy-keymap (current-global-map)) - "Local keymap for Crisp mode. + "Local keymap for CRiSP emulation mode. All the bindings are done here instead of globally to try and be nice to the world.") -(defvar crisp-mode-modeline-string " *Crisp*" - "String to display in the modeline when Crisp mode is enabled.") +(defvar crisp-mode-modeline-string " *CRiSP*" + "String to display in the modeline when CRiSP emulation mode is enabled.") (defvar crisp-mode-original-keymap (copy-keymap (current-global-map)) - "The original keymap before Crisp mode remaps anything. -This keymap is restored when Crisp mode is disabled.") + "The original keymap before CRiSP emulation mode remaps anything. +This keymap is restored when CRiSP emulation mode is disabled.") (defvar crisp-mode-enabled 'nil - "Track status of Crisp mode. -A value of nil means Crisp mode is not enabled. A value of t -indicates Crisp mode is enabled.") + "Track status of CRiSP emulation mode. +A value of nil means CRiSP mode is not enabled. A value of t +indicates CRiSP mode is enabled.") (defvar crisp-override-meta-x 't - "Controls overriding the normal Emacs M-x key binding. -The normal binding for M-x is `execute-extended-command', however -the normal Crisp keybinding for M-x is to exit the editor, while -the F10 key is used to execute extended commands. If you don't -want M-x to dump you out of emacs, set this to nil before loading -the package.") + "Controls overriding the normal Emacs M-x key binding in the CRiSP emulator. +Normally the CRiSP emulator rebinds M-x to save-buffers-exit-emacs +and provides the usual M-x functionality on the F10 key. + +If this variable is nil when you start the CRiSP emulator, it +does not alter the binding of M-x.") (defvar crisp-load-scroll-lock 't - "Controls loading of the Scroll Lock minor mode package. -Default behavior is to load the scroll lock minor mode -package when Crisp mode is enabled. Set to nil prior -to loading this package to prevent it.") + "Controls loading of the Scroll Lock in the CRiSP emulator. +Its Default behavior is to load and enable the Scroll Lock minor mode +package when enabling the CRiSP emulator. + +If this variable is nil when you start the CRiSP emulator, it +does not load Scroll Lock.") (defvar crisp-load-hook nil - "Hooks to run after Crisp mode is enabled.") + "Hooks to run after loadint the CRiSP emulator package.") -(defvar crisp-mode-running-xemacs (string-match "XEmacs\\Lucid" emacs-version)) +(defvar crisp-version "crisp.el release 1.1/$Revision: 1.2 $" + "The release number and RCS version for the CRiSP emulator.") -(if crisp-mode-running-xemacs +(if (string-match "XEmacs\\Lucid" emacs-version) (add-minor-mode 'crisp-mode-enabled crisp-mode-modeline-string) (or (assq 'crisp-mode-enabled minor-mode-alist) (setq minor-mode-alist @@ -127,8 +132,8 @@ (define-key crisp-mode-map [(meta f10)] 'compile) (define-key crisp-mode-map [(SunF37)] 'kill-buffer) -(define-key crisp-mode-map [(kp_add)] 'x-copy-primary-selection) -(define-key crisp-mode-map [(kp_subtract)] 'x-kill-primary-selection) +(define-key crisp-mode-map [(kp-add)] 'x-copy-primary-selection) +(define-key crisp-mode-map [(kp-subtract)] 'x-kill-primary-selection) (define-key crisp-mode-map [(insert)] 'x-yank-clipboard-selection) (define-key crisp-mode-map [(f16)] 'x-copy-primary-selection) ; copy on Sun5 kbd (define-key crisp-mode-map [(f20)] 'x-kill-primary-selection) ; cut on Sun5 kbd @@ -139,12 +144,23 @@ (define-key crisp-mode-map [(meta g)] 'goto-line) (define-key crisp-mode-map [(meta h)] 'help) (define-key crisp-mode-map [(meta i)] 'overwrite-mode) +(define-key crisp-mode-map [(meta j)] 'bookmark-jump) (define-key crisp-mode-map [(meta u)] 'advertised-undo) (define-key crisp-mode-map [(f14)] 'advertised-undo) (define-key crisp-mode-map [(meta w)] 'save-buffer) (if (eq crisp-override-meta-x 't) - (define-key crisp-mode-map [(meta x)] 'save-buffers-kill-emacs)) + (define-key crisp-mode-map [(meta x)] 'save-buffers-kill-emacs)) +(define-key crisp-mode-map [(meta ?0)] (lambda () (interactive) (bookmark-set "0"))) +(define-key crisp-mode-map [(meta ?1)] (lambda () (interactive) (bookmark-set "1"))) +(define-key crisp-mode-map [(meta ?2)] (lambda () (interactive) (bookmark-set "2"))) +(define-key crisp-mode-map [(meta ?3)] (lambda () (interactive) (bookmark-set "3"))) +(define-key crisp-mode-map [(meta ?4)] (lambda () (interactive) (bookmark-set "4"))) +(define-key crisp-mode-map [(meta ?5)] (lambda () (interactive) (bookmark-set "5"))) +(define-key crisp-mode-map [(meta ?6)] (lambda () (interactive) (bookmark-set "6"))) +(define-key crisp-mode-map [(meta ?7)] (lambda () (interactive) (bookmark-set "7"))) +(define-key crisp-mode-map [(meta ?8)] (lambda () (interactive) (bookmark-set "8"))) +(define-key crisp-mode-map [(meta ?9)] (lambda () (interactive) (bookmark-set "9"))) (define-key crisp-mode-map [(shift right)] 'fkey-forward-word) (define-key crisp-mode-map [(shift left)] 'fkey-backward-word) @@ -157,10 +173,10 @@ (define-key crisp-mode-map [(end)] 'crisp-end) (defun crisp-home () - "Home the point according to Crisp conventions. -First call to this moves point to beginning of the line. Second -consecutive call moves point to beginning of the screen. Third -consecutive call moves the point to the beginning of the buffer." + "\"Home\" the point, the way CRiSP would do it. +The first use moves point to beginning of the line. Second +consecutive use moves point to beginning of the screen. Third +consecutive use moves point to the beginning of the buffer." (interactive nil) (cond ((and (eq last-command 'crisp-home) (eq last-last-command 'crisp-home)) @@ -172,10 +188,10 @@ (setq last-last-command last-command)) (defun crisp-end () - "End the point according to Crisp conventions. -First call to this moves point to end of the line. Second -consecutive call moves point to the end of the screen. Third -consecutive call moves point to the end of the buffer." + "\"End\" the point, the way CRiSP would do it. +The first use moves point to end of the line. Second +consecutive use moves point to the end of the screen. Third +consecutive use moves point to the end of the buffer." (interactive nil) (cond ((and (eq last-command 'crisp-end) (eq last-last-command 'crisp-end)) @@ -190,7 +206,7 @@ ;; Now enable the mode (defun crisp-mode () - "Toggle Crisp minor mode." + "Toggle CRiSP emulation minor mode." (interactive nil) (setq crisp-mode-enabled (not crisp-mode-enabled)) (cond