X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4787a496a05fdc03241850b45911dd283d4b06b8..5009803bda518652cc6f4b9fba02c0aed185c2a3:/lisp/emulation/viper-keym.el diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index dc24b83e3b..f3bd6bece6 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el @@ -1,9 +1,9 @@ ;;; viper-keym.el --- Viper keymaps -;; Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +;; Copyright (C) 1994-1997, 2000-2011 Free Software Foundation, Inc. ;; Author: Michael Kifer +;; Package: viper ;; This file is part of GNU Emacs. @@ -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,10 +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 ;;; viper-keym.el ends here