[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 12/56: (crisp-mode-map): Don't inherit global-map. Enter it on mi
From: |
Luke Lee |
Subject: |
[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. |
Date: |
Thu, 28 Aug 2014 02:21:41 +0000 |
lukelee pushed a commit to branch master
in repository elpa.
commit 03a6b3c614aaa0ad2535eb416e82566737ec3258
Author: Richard M. Stallman <address@hidden>
Date: Mon May 24 22:23:35 1999 +0000
(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.
---
lisp/emulation/crisp.el | 62 ++++++++++++++++++++++++++--------------------
1 files changed, 35 insertions(+), 27 deletions(-)
diff --git a/lisp/emulation/crisp.el b/lisp/emulation/crisp.el
index 3ac1374..ecc0a35 100644
--- a/lisp/emulation/crisp.el
+++ b/lisp/emulation/crisp.el
@@ -1,6 +1,6 @@
;;; crisp.el --- CRiSP/Brief Emacs emulator
-;; Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
;; Author: Gary D. Foster <address@hidden>
;; Keywords: emulations brief crisp
@@ -42,9 +42,9 @@
;; key to exit the editor. If you don't like this functionality, you
;; can prevent this behavior (or redefine it dynamically) by setting
;; the value of `crisp-override-meta-x' either in your .emacs or
-;; interactively. The default setting is nil, which means that M-x will
-;; by default run `execute-extended-command' instead of the command
-;; `save-buffers-kill-emacs'.
+;; interactively. The default setting is t, which means that M-x will
+;; by default run `save-buffers-kill-emacs' instead of the command
+;; `execute-extended-command'.
;; Finally, if you want to change the string displayed in the modeline
;; when this mode is in effect, override the definition of
@@ -64,7 +64,6 @@
:group 'emulations)
(defvar crisp-mode-map (let ((map (make-sparse-keymap)))
- (set-keymap-parent map (current-global-map))
map)
"Local keymap for CRiSP emulation mode.
All the bindings are done here instead of globally to try and be
@@ -75,14 +74,17 @@ nice to the world.")
:type 'string
:group 'crisp)
-(defvar crisp-mode-original-keymap (current-global-map)
- "The original keymap before CRiSP emulation mode remaps anything.
-This keymap is restored when CRiSP emulation mode is disabled.")
-
-(defcustom crisp-mode-enabled nil
+;;;###autoload
+(defcustom crisp-mode nil
"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."
+indicates CRiSP mode is enabled.
+
+Setting this variable directly does not take effect;
+use either M-x customize or the function `crisp-mode'."
+ :set (lambda (symbol value) (crisp-mode (if value 1 0)))
+ :require 'crisp
+ :version "20.4"
:type 'boolean
:group 'crisp)
@@ -109,7 +111,12 @@ does not load the scroll-all package."
:type 'hook
:group 'crisp)
-(defconst crisp-version "1.33"
+(defcustom crisp-mode-hook nil
+ "Hook run by the function `crisp-mode'."
+ :type 'hook
+ :group 'crisp)
+
+(defconst crisp-version "1.34"
"The version of the CRiSP emulator.")
(defconst crisp-mode-help-address "address@hidden"
@@ -270,7 +277,8 @@ If ARG, insert results at point."
(message foo))))
(defun crisp-mark-line (arg)
- "Set mark at the end of the line. Arg works as in `end-of-line'."
+ "Set mark at the end of the line.
+Arg works as in `end-of-line'."
(interactive "p")
(let (newmark)
(save-excursion
@@ -337,7 +345,7 @@ consecutive use moves point to the end of the buffer."
(setq crisp-last-last-command last-command))
(defun crisp-unbury-buffer ()
- "Go back one buffer"
+ "Go back one buffer."
(interactive)
(switch-to-buffer (car (last (buffer-list)))))
@@ -374,30 +382,30 @@ normal CRiSP binding) and when it is nil M-x will run
;; Now enable the mode
+;;;###autoload
(defun crisp-mode (&optional arg)
"Toggle CRiSP emulation minor mode.
With ARG, turn CRiSP mode on if ARG is positive, off otherwise."
(interactive "P")
- (setq crisp-mode-enabled (if (null arg)
- (not crisp-mode-enabled)
- (> (prefix-numeric-value arg) 0)))
- (cond
- ((eq crisp-mode-enabled 't)
- (use-global-map crisp-mode-map)
+ (setq crisp-mode (if (null arg)
+ (not crisp-mode)
+ (> (prefix-numeric-value arg) 0)))
+ (when crisp-mode
(if crisp-load-scroll-all
(require 'scroll-all))
(if (featurep 'scroll-all)
(define-key crisp-mode-map [(meta f1)] 'scroll-all-mode))
- (run-hooks 'crisp-load-hook))
- ((eq crisp-mode-enabled 'nil)
- (use-global-map crisp-mode-original-keymap))))
+ (run-hooks 'crisp-load-hook)))
(if (fboundp 'add-minor-mode)
- (add-minor-mode 'crisp-mode-enabled 'crisp-mode-modeline-string
- nil nil 'crisp-mode)
- (or (assq 'crisp-mode-enabled minor-mode-alist)
+ (add-minor-mode 'crisp-mode 'crisp-mode-modeline-string
+ crisp-mode-map nil 'crisp-mode)
+ (or (assq 'crisp-mode minor-mode-alist)
(setq minor-mode-alist
- (cons '(crisp-mode-enabled crisp-mode-modeline-string)
minor-mode-alist))))
+ (cons '(crisp-mode crisp-mode-modeline-string) minor-mode-alist)))
+ (or (assq 'crisp-mode minor-mode-map-alist)
+ (setq minor-mode-map-alist (cons (cons 'crisp-mode crisp-mode-map)
+ minor-mode-map-alist))))
(provide 'crisp)
- [elpa] 51/56: Aliases to defcustoms must come before the defcustom., (continued)
- [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, 2014/08/27
- [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 <=
- [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
- [elpa] 15/56: Update author address., Luke Lee, 2014/08/27
- [elpa] 08/56: Added next-buffer/previous-buffer keybindings (bound to M-n/M-p). (crisp-unbury-buffer): New function., Luke Lee, 2014/08/27
- [elpa] 16/56: (brief-mode): New alias., Luke Lee, 2014/08/27
- [elpa] 17/56: Trailing whitepace deleted., Luke Lee, 2014/08/27
- [elpa] 18/56: * man.el (Man-getpage-in-background): Always use `setenv' for environment variables, instead of modifying process-environment directly. The previous version let-bound process-environment -- the let-binding is skipped for GROFF_NO_SGR because there is already a let-binding in effect in some outer scope., Luke Lee, 2014/08/27
- [elpa] 20/56: Add arch taglines, Luke Lee, 2014/08/27
- [elpa] 22/56: Sync to HEAD, Luke Lee, 2014/08/27
- [elpa] 19/56: (top-level): Quote second arg to `eval-after-load'., Luke Lee, 2014/08/27