comparison lisp/emulators/crisp.el @ 185:3d6bfa290dbd r20-3b19

Import from CVS: tag r20-3b19
author cvs
date Mon, 13 Aug 2007 09:55:28 +0200
parents 8eaf7971accc
children e45d5e7c476e
comparison
equal deleted inserted replaced
184:bcd2674570bf 185:3d6bfa290dbd
1 ;; @(#) crisp.el -- CRiSP/Brief Emacs emulator 1 ;; @(#) crisp.el -- CRiSP/Brief Emacs emulator
2 2
3 ;; Author: Gary D. Foster <Gary.Foster@corp.sun.com> 3 ;; Author: Gary D. Foster <Gary.Foster@corp.sun.com>
4 ;; 1.19 4 ;; Created: 01 Mar 1996
5 ;; Version: 1.20
5 ;; Keywords: emulations brief crisp 6 ;; Keywords: emulations brief crisp
7 ;; X-Modified-by:
8 ;; crisp.el,v
9 ;; Revision 1.20 1997/08/22 18:49:11 gfoster
10 ;; Added next-buffer/previous-buffer keybindings (bound to M-n/M-p)
11 ;; Added crisp-unbury-buffer function
12 ;; Standardized headers for Steve
13 ;;
6 14
7 ;; This file is part of XEmacs. 15 ;; This file is part of XEmacs.
8 16
9 ;; XEmacs is free software; you can redistribute it and/or modify it 17 ;; XEmacs is free software; you can redistribute it and/or modify it
10 ;; under the terms of the GNU General Public License as published by 18 ;; under the terms of the GNU General Public License as published by
53 ;; " *Crisp*" which may be a bit lengthy if you have a lot of things 61 ;; " *Crisp*" which may be a bit lengthy if you have a lot of things
54 ;; being displayed there. 62 ;; being displayed there.
55 63
56 ;; All these overrides should go *before* the (require 'crisp) statement. 64 ;; All these overrides should go *before* the (require 'crisp) statement.
57 65
66 ;; Code:
67
68 (require 'cl)
69
58 ;; local variables 70 ;; local variables
59 71
60 (defgroup emulations-crisp nil 72 (defgroup emulations-crisp nil
61 "CRiSP emulator customizable settings." 73 "CRiSP emulator customizable settings."
62 :group 'emulations) 74 :group 'emulations)
97 does not load the scroll-lock package.") 109 does not load the scroll-lock package.")
98 110
99 (defvar crisp-load-hook nil 111 (defvar crisp-load-hook nil
100 "Hooks to run after loading the CRiSP emulator package.") 112 "Hooks to run after loading the CRiSP emulator package.")
101 113
102 (defconst crisp-version "crisp.el release 1.1/1.19" 114 (defconst crisp-version "crisp.el release 1.1/1.20"
103 "The release number and RCS version for the CRiSP emulator.") 115 "The release number and RCS version for the CRiSP emulator.")
104 116
105 (if (string-match "XEmacs\\Lucid" emacs-version) 117 (if (string-match "XEmacs\\Lucid" emacs-version)
106 (add-minor-mode 'crisp-mode-enabled crisp-mode-modeline-string) 118 (add-minor-mode 'crisp-mode-enabled crisp-mode-modeline-string)
107 (or (assq 'crisp-mode-enabled minor-mode-alist) 119 (or (assq 'crisp-mode-enabled minor-mode-alist)
152 (define-key crisp-mode-map [(meta e)] 'find-file) 164 (define-key crisp-mode-map [(meta e)] 'find-file)
153 (define-key crisp-mode-map [(meta g)] 'goto-line) 165 (define-key crisp-mode-map [(meta g)] 'goto-line)
154 (define-key crisp-mode-map [(meta h)] 'help) 166 (define-key crisp-mode-map [(meta h)] 'help)
155 (define-key crisp-mode-map [(meta i)] 'overwrite-mode) 167 (define-key crisp-mode-map [(meta i)] 'overwrite-mode)
156 (define-key crisp-mode-map [(meta j)] 'bookmark-jump) 168 (define-key crisp-mode-map [(meta j)] 'bookmark-jump)
169 (define-key crisp-mode-map [(meta n)] 'bury-buffer)
170 (define-key crisp-mode-map [(meta p)] 'crisp-unbury-buffer)
157 (define-key crisp-mode-map [(meta u)] 'advertised-undo) 171 (define-key crisp-mode-map [(meta u)] 'advertised-undo)
158 (define-key crisp-mode-map [(f14)] 'advertised-undo) 172 (define-key crisp-mode-map [(f14)] 'advertised-undo)
159 (define-key crisp-mode-map [(meta w)] 'save-buffer) 173 (define-key crisp-mode-map [(meta w)] 'save-buffer)
160 (define-key crisp-mode-map [(meta x)] 'crisp-meta-x-wrapper) 174 (define-key crisp-mode-map [(meta x)] 'crisp-meta-x-wrapper)
161 (define-key crisp-mode-map [(meta ?0)] (lambda () (interactive) (bookmark-set "0"))) 175 (define-key crisp-mode-map [(meta ?0)] (lambda () (interactive) (bookmark-set "0")))
208 (end-of-line)) 222 (end-of-line))
209 (t 223 (t
210 (end-of-line))) 224 (end-of-line)))
211 (setq last-last-command last-command)) 225 (setq last-last-command last-command))
212 226
227 (defun crisp-unbury-buffer ()
228 "Go back one buffer"
229 (interactive)
230 (switch-to-buffer (car (last (buffer-list)))))
231
213 (defun crisp-meta-x-wrapper () 232 (defun crisp-meta-x-wrapper ()
214 "Wrapper function to conditionally override the normal M-x bindings. 233 "Wrapper function to conditionally override the normal M-x bindings.
215 When `crisp-override-meta-x' is non-nil, M-x will exit Emacs (the 234 When `crisp-override-meta-x' is non-nil, M-x will exit Emacs (the
216 normal CRiSP binding) and when it is nil M-x will run 235 normal CRiSP binding) and when it is nil M-x will run
217 `execute-extended-command' (the normal Emacs binding)." 236 `execute-extended-command' (the normal Emacs binding)."