aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emulation
diff options
context:
space:
mode:
authorKarl Heuer <[email protected]>1999-06-13 02:37:28 +0000
committerKarl Heuer <[email protected]>1999-06-13 02:37:28 +0000
commit6110ea0a1af3e48e5f291900433c67bec4a81c12 (patch)
treeffd537aee847551628dbf51e4119f8f532f6c5a7 /lisp/emulation
parentfc35b9101a533039902105fa3b65c500906effcb (diff)
(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.
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/crisp.el22
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/emulation/crisp.el b/lisp/emulation/crisp.el
index 5b274fc92c..4e41bdfae2 100644
--- a/lisp/emulation/crisp.el
+++ b/lisp/emulation/crisp.el
@@ -84,6 +84,7 @@ 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)))
+ :initialize 'custom-initialize-default
:require 'crisp
:version "20.4"
:type 'boolean
@@ -145,15 +146,6 @@ does not load the scroll-all package."
'clipboard-yank
'yank-clipboard-selection))
-;; force transient-mark-mode in Emacs, so that the marking routines
-;; work as expected. If the user turns off transient mark mode,
-;; most things will still work fine except the crisp-(copy|kill)
-;; functions won't work quite as nicely when regions are marked
-;; differently and could really confuse people. Caveat emptor.
-
-(if (fboundp 'transient-mark-mode)
- (transient-mark-mode t))
-
(defun crisp-region-active ()
"Compatibility function to test for an active region."
(if (boundp 'zmacs-region-active-p)
@@ -358,8 +350,6 @@ normal CRiSP binding) and when it is nil M-x will run
(save-buffers-kill-emacs)
(call-interactively 'execute-extended-command)))
-;; Now enable the mode
-
;;;###autoload
(defun crisp-mode (&optional arg)
"Toggle CRiSP emulation minor mode.
@@ -369,11 +359,18 @@ With ARG, turn CRiSP mode on if ARG is positive, off otherwise."
(not crisp-mode)
(> (prefix-numeric-value arg) 0)))
(when crisp-mode
+ ;; Force transient-mark-mode, so that the marking routines work as
+ ;; expected. If the user turns off transient mark mode, most
+ ;; things will still work fine except the crisp-(copy|kill)
+ ;; functions won't work quite as nicely when regions are marked
+ ;; differently and could really confuse people. Caveat emptor.
+ (if (fboundp 'transient-mark-mode)
+ (transient-mark-mode t))
(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)))
+ (run-hooks 'crisp-mode-hook)))
(if (fboundp 'add-minor-mode)
(add-minor-mode 'crisp-mode 'crisp-mode-modeline-string
@@ -385,6 +382,7 @@ With ARG, turn CRiSP mode on if ARG is positive, off otherwise."
(setq minor-mode-map-alist (cons (cons 'crisp-mode crisp-mode-map)
minor-mode-map-alist))))
+(run-hooks 'crisp-load-hook)
(provide 'crisp)
;;; crisp.el ends here