Add 2011 to FSF/AIST copyright years.
[bpt/emacs.git] / lisp / emulation / viper-keym.el
index dc24b83..a3dda4e 100644 (file)
@@ -1,7 +1,7 @@
 ;;; viper-keym.el --- Viper keymaps
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
@@ -165,8 +165,7 @@ Enter as a sexp.  Examples: \"\\C-z\", [(control ?z)]."
                            [(control ?z)])))
           (mapc
            (lambda (buf)
-             (save-excursion
-               (set-buffer buf)
+             (with-current-buffer buf
                (when (and (boundp 'viper-insert-basic-map)
                           (keymapp viper-insert-basic-map))
                  (when old-value
@@ -193,36 +192,8 @@ Enter as a sexp.  Examples: \"\\C-z\", [(control ?z)]."
   :type 'string
   :group 'viper)
 
-(defcustom viper-ESC-key (if (viper-window-display-p) [(escape)] "\e")
-  "Key used to ESC.
-Enter as a sexp. Examples: \"\\e\", [(escape)].
-If running in a terminal, [(escape)] is not understood, so must use \"\\e\"."
-  :type 'sexp
-  :group 'viper
-  :set (lambda (symbol value)
-        (let ((old-value (if (boundp 'viper-ESC-key)
-                             viper-ESC-key
-                           [(escape)])))
-          (mapc
-           (lambda (buf)
-             (save-excursion
-               (set-buffer buf)
-               (when (and (boundp 'viper-insert-intercept-map)
-                          (keymapp viper-insert-intercept-map))
-                 (when old-value
-                   (define-key viper-insert-intercept-map old-value nil))
-                 (define-key
-                   viper-insert-intercept-map value 'viper-intercept-ESC-key))
-               (when (and (boundp 'viper-vi-intercept-map)
-                          (keymapp viper-vi-intercept-map))
-                 (when old-value
-                   (define-key viper-vi-intercept-map old-value nil))
-                 (define-key
-                   viper-vi-intercept-map value 'viper-intercept-ESC-key))
-               ))
-           (buffer-list))
-          (set-default symbol value)
-           )))
+(defvar viper-ESC-key (kbd "ESC")
+  "Key used to ESC.")
 
 
 ;;; Variables used by minor modes
@@ -696,9 +667,9 @@ form ((key . function) (key . function) ... )."
 (provide 'viper-keym)
 
 
-;;; Local Variables:
-;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
-;;; End:
+;; Local Variables:
+;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
+;; End:
 
 
 ;; arch-tag: 43af4b2f-0bea-400b-889e-221ebc00acb1