[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/56: Initial revision
From: |
Luke Lee |
Subject: |
[elpa] 01/56: Initial revision |
Date: |
Thu, 28 Aug 2014 02:21:36 +0000 |
lukelee pushed a commit to branch master
in repository elpa.
commit 9d784800131a2fef0a7391321646caa24f2dc781
Author: Richard M. Stallman <address@hidden>
Date: Thu Apr 10 20:43:54 1997 +0000
Initial revision
---
lisp/emulation/crisp.el | 189 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 189 insertions(+), 0 deletions(-)
diff --git a/lisp/emulation/crisp.el b/lisp/emulation/crisp.el
new file mode 100644
index 0000000..5b7ab76
--- /dev/null
+++ b/lisp/emulation/crisp.el
@@ -0,0 +1,189 @@
+;; crisp.el -- Emulator for CRiSP/Brief key bindings
+
+;; Author: Gary D. Foster <address@hidden>
+;; Keywords: emulations brief crisp
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This file provides keybindings and minor functions to duplicate the
+;; functionality and finger-feel of the CRiSP/Brief editor. This
+;; package is designed to facilitate transitioning from Brief to Emacs
+;; with a minimum amount of hassles.
+
+;; Enable this package by putting the following in your .emacs
+;; (require 'crisp)
+
+;; This package will automatically default to loading the scroll-lock.el
+;; package unless you put (setq crisp-load-scroll-lock nil) in your
+;; .emacs. If this feature is enabled, it will bind meta-f1 to the
+;; scroll-lock mode toggle.
+
+;; Also, the default keybindings for brief override the Meta-x key to
+;; exit the editor. If you don't like this functionality, you can
+;; prevent this key from being rebound with
+;; (setq crisp-override-meta-x nil) in your .emacs.
+
+;; All these overrides should go *before* the (require 'crisp) statement.
+
+;; local variables
+
+(defvar crisp-mode-map (copy-keymap (current-global-map))
+ "Keymap for CRiSP emulation.
+All the emulation bindings are done here instead of globally.")
+
+(defvar crisp-override-meta-x t
+ "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 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 loading the CRiSP emulator package.")
+
+;; and now the keymap defines
+
+(define-key crisp-mode-map [(f1)] 'other-window)
+
+(define-key crisp-mode-map [(f2) (down)] 'enlarge-window)
+(define-key crisp-mode-map [(f2) (left)] 'shrink-window-horizontally)
+(define-key crisp-mode-map [(f2) (right)] 'enlarge-window-horizontally)
+(define-key crisp-mode-map [(f2) (up)] 'shrink-window)
+(define-key crisp-mode-map [(f3) (down)] 'split-window-vertically)
+(define-key crisp-mode-map [(f3) (right)] 'split-window-horizontally)
+
+(define-key crisp-mode-map [(f4)] 'delete-window)
+(define-key crisp-mode-map [(control f4)] 'delete-other-windows)
+
+(define-key crisp-mode-map [(f5)] 'search-forward-regexp)
+(define-key crisp-mode-map [(f19)] 'search-forward-regexp)
+(define-key crisp-mode-map [(meta f5)] 'search-backward-regexp)
+
+(define-key crisp-mode-map [(f6)] 'query-replace)
+
+(define-key crisp-mode-map [(f7)] 'start-kbd-macro)
+(define-key crisp-mode-map [(meta f7)] 'end-kbd-macro)
+
+(define-key crisp-mode-map [(f8)] 'call-last-kbd-macro)
+(define-key crisp-mode-map [(meta f8)] 'save-kbd-macro)
+
+(define-key crisp-mode-map [(f9)] 'find-file)
+(define-key crisp-mode-map [(meta f9)] 'load-library)
+
+(define-key crisp-mode-map [(f10)] 'execute-extended-command)
+(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 [(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
+(define-key crisp-mode-map [(f18)] 'x-yank-clipboard-selection) ;
paste on Sun5 kbd
+
+(define-key crisp-mode-map [(meta d)] (lambda () (interactive)
(beginning-of-line) (kill-line)))
+(define-key crisp-mode-map [(meta e)] 'find-file)
+(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 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 [(shift right)] 'fkey-forward-word)
+(define-key crisp-mode-map [(shift left)] 'fkey-backward-word)
+(define-key crisp-mode-map [(shift delete)] 'kill-word)
+(define-key crisp-mode-map [(shift backspace)] 'backward-kill-word)
+(define-key crisp-mode-map [(control left)] 'backward-word)
+(define-key crisp-mode-map [(control right)] 'forward-word)
+
+(define-key crisp-mode-map [(home)] 'crisp-home)
+(define-key crisp-mode-map [(end)] 'crisp-end)
+
+
+(defun crisp-home ()
+ "\"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))
+ (goto-char (point-min))
+ )
+ ((eq last-command 'crisp-home)
+ (move-to-window-line 0)
+ )
+ (t
+ (beginning-of-line)
+ )
+ )
+ (setq last-last-command last-command)
+)
+
+(defun crisp-end ()
+ "\"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))
+ (goto-char (point-max))
+ )
+ ((eq last-command 'crisp-end)
+ (move-to-window-line -1)
+ (end-of-line)
+ )
+ (t
+ (end-of-line)
+ )
+ )
+ (setq last-last-command last-command)
+)
+
+;; Now enable the mode
+
+(kill-all-local-variables)
+(use-global-map crisp-mode-map)
+
+(if (eq crisp-load-scroll-lock t)
+ (require 'scroll-lock))
+
+(if (featurep 'scroll-lock)
+ (define-key crisp-mode-map [(meta f1)] 'scroll-lock-mode))
+
+(run-hooks 'crisp-load-hook) ;; allow for hooks
+
+(provide 'crisp)
+
+;; crisp.el ends here
- [elpa] 39/56: Remove leading `*' from docs of some defcustoms etc., (continued)
- [elpa] 39/56: Remove leading `*' from docs of some defcustoms etc., Luke Lee, 2014/08/27
- [elpa] 42/56: Refill some copyright headers., Luke Lee, 2014/08/27
- [elpa] 37/56: * emulation/crisp.el (crisp-mode-map): Move initialization into declaration. (crisp-mode): Use define-minor-mode., Luke Lee, 2014/08/27
- [elpa] 41/56: Nuke arch-tags., Luke Lee, 2014/08/27
- [elpa] 47/56: Add 2012 to FSF copyright years for Emacs files, Luke Lee, 2014/08/27
- [elpa] 50/56: Replace version 24.2 with 24.3 where appropriate (hopefully), Luke Lee, 2014/08/27
- [elpa] 43/56: Convert consecutive FSF copyright years to ranges., Luke Lee, 2014/08/27
- [elpa] 49/56: Reduce use of (require 'cl). * admin/bzrmerge.el: Use cl-lib. * leim/quail/hangul.el: Don't require CL. * leim/quail/ipa.el: Use cl-lib. * vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el: * vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el: * register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el: * msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el: * international/quail.el, info-xref.el, imenu.el, image-mode.el: * font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el: * battery.el, avoid.el, abbrev.el: Use cl-lib. * vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el: * vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el: * jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el: * emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el: * calculator.el, autorevert.el, apropos.el: Don't require CL. * emacs-bytecomp.el (byte-recompile-directory, display-call-tree) (byte-compile-unfold-bcf, byte-compile-check-variable): * emacs-byte-opt.el (byte-compile-trueconstp) (byte-compile-nilconstp): * emacs-autoload.el (make-autoload): Use pcase. * face-remap.el (text-scale-adjust): Simplify pcase patterns., Luke Lee, 2014/08/27
- [elpa] 51/56: Aliases to defcustoms must come before the defcustom., Luke Lee, 2014/08/27
- [elpa] 05/56: (crisp-last-last-command): Renamed from last-last-command and defvar added., Luke Lee, 2014/08/27
- [elpa] 01/56: Initial revision,
Luke Lee <=
- [elpa] 04/56: (crisp-load-scroll-all): Renamed from ...-lock. (crisp-mode): Use scroll-all... not scroll-lock..., Luke Lee, 2014/08/27
- [elpa] 03/56: Install the proper version., Luke Lee, 2014/08/27
- [elpa] 06/56: (crisp-mode): Add autoload cookie., Luke Lee, 2014/08/27
- [elpa] 07/56: Customized., Luke Lee, 2014/08/27
- [elpa] 10/56: (crisp-mark-line): Greatly simplified., Luke Lee, 2014/08/27
- [elpa] 11/56: Fix header comments., Luke Lee, 2014/08/27
- [elpa] 09/56: Don't require cl. (crisp-override-meta-x): Doc fix. (crisp-last-last-command): Doc fix. (mark-something): Function deleted. (crisp-mark-line): Avoid using mark-something. (crisp-region-active): Renamed from region-active. (crisp-set-clipboard): Renamed from copy-primary-selection. (crisp-kill-region): Renamed from kill-primary-selection. (crisp-yank-clipboard): Renamed from yank-clipboard-selection., Luke Lee, 2014/08/27
- [elpa] 12/56: (crisp-mode-map): Don't inherit global-map. Enter it on minor-mode-map-alist. (crisp-mode): Re-named from `crsip-mode-enabled'. Users changed. Autoload. Add custom setter. (crisp-mark-line): Doc fix. (crisp-mode): Autoload. Re-write not to frob keymaps directly. (crisp-mode-hook): Define., Luke Lee, 2014/08/27
- [elpa] 13/56: (crisp-submit-bug-report): Function deleted. Binding deleted also., Luke Lee, 2014/08/27
- [elpa] 14/56: (crisp-mode): (defcustom) Initialize with custom-initialize-default to avoid infinite loop. (crisp-mode): (defun) Call transient-mark-mode here, not when loading the file. Run crisp-mode-hook here, and run crisp-load-hook when loading the file., Luke Lee, 2014/08/27