summaryrefslogtreecommitdiff
path: root/lisp/double.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-08-01 19:01:15 +0000
committerRichard M. Stallman <rms@gnu.org>1998-08-01 19:01:15 +0000
commit8fe4a3fba226f6adb9af72b34a1f5f70fd66af58 (patch)
tree35eaa19eeb0051a036ab0cfd50d0b75979bc0887 /lisp/double.el
parentd85f4ec5e4988ca953c346414b878e1f88903e1c (diff)
downloademacs-8fe4a3fba226f6adb9af72b34a1f5f70fd66af58.tar.gz
(default-key-translation-map): Variable deleted.
(double-setup): Make key-translation-map buffer-local here. New arg ENABLE-FLAG. (double-mode): Pass ENABLE-FLAG arg to double-setup.
Diffstat (limited to 'lisp/double.el')
-rw-r--r--lisp/double.el34
1 files changed, 16 insertions, 18 deletions
diff --git a/lisp/double.el b/lisp/double.el
index a494c6585be..8585f8716c8 100644
--- a/lisp/double.el
+++ b/lisp/double.el
@@ -1,6 +1,6 @@
;;; double.el --- Support for keyboard remapping with double clicking
-;; Copyright (C) 1994,1997 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc.
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Keywords: i18n
@@ -139,21 +139,19 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
;;; Key Translation Map
-(defvar default-key-translation-map
- (or key-translation-map (make-sparse-keymap))
- "Key translation you want to have effect, regardless of Double mode.
-This defaults to the value of `key-translation-map' when double was
-first loaded.")
-
-(make-variable-buffer-local 'key-translation-map)
-
-(defun double-setup ()
- ;; Setup key-translation-map as indicated by `double-map'.
- (setq key-translation-map (copy-keymap default-key-translation-map))
- (mapcar (function (lambda (entry)
- (define-key key-translation-map (vector (nth 0 entry))
- 'double-translate-key)))
- (append double-map '((magic-start) (magic-end)))))
+(defun double-setup (enable-flag)
+ (if enable-flag
+ (progn
+ ;; Set up key-translation-map as indicated by `double-map'.
+ (kill-local-variable 'key-translation-map)
+ (make-local-variable 'key-translation-map)
+ (setq key-translation-map (copy-keymap key-translation-map))
+ (mapcar (function (lambda (entry)
+ (define-key key-translation-map
+ (vector (nth 0 entry))
+ 'double-translate-key)))
+ (append double-map '((magic-start) (magic-end)))))
+ (kill-local-variable 'key-translation-map)))
;;; Mode
@@ -185,13 +183,13 @@ when pressed twice. See variable `double-map' for details."
(if double-mode
(progn
(let ((double-map))
- (double-setup))
+ (double-setup nil))
(setq double-mode nil)
(force-mode-line-update)))
;;Turn it on
(if double-mode
()
- (double-setup)
+ (double-setup t)
(setq double-mode t)
(force-mode-line-update))))