From 8ea74b0e4570fe6e3ee583b0655bf6137d82dc28 Mon Sep 17 00:00:00 2001 From: Michael Kifer Date: Sun, 10 Jul 2005 18:46:24 +0000 Subject: * viper-cmd.el (viper--key-maps): new variable. (viper-normalize-minor-mode-map-alist): use viper--key-maps and emulation-mode-map-alists. (viper-envelop-ESC-key): use viper-subseq. (viper-search-forward/backward/next): disable debug-on-error. * viper-keym.el (viper-toggle-key,viper-quoted-insert-key, viper-ESC-key): new defcustoms. * viper-macs.el (ex-map-read-args): use viper-subseq. * viper-util.el (viper-key-to-emacs-key): use viper-subseq. (viper-subseq): copy of subseq from cl.el. * viper.el (viper-go-away,viper-set-hooks): use emulation-mode-map-alists, advise self-insert-command, add-minor-mode. * viper-mous.el (viper-current-frame-saved): use defvar. * viper-init.el: got rid of -face in face names. * ediff-diff.el (ediff-extract-diffs,ediff-extract-diffs3): Make it work with longlines mode * ediff-mult.el (ediff-meta-mode-hook): new variable. * ediff-ptch.el (ediff-file-name-sans-prefix): quote regexp. * ediff-init: got rid of -face in face names. --- lisp/emulation/viper.el | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'lisp/emulation/viper.el') diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index fe65cb69cbb..3a95fa26835 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -8,7 +8,7 @@ ;; Author: Michael Kifer ;; Keywords: emulations -(defconst viper-version "3.11.4 of February 19, 2005" +(defconst viper-version "3.11.5 of July 8, 2005" "The current version of Viper") ;; This file is part of GNU Emacs. @@ -320,6 +320,7 @@ ;; end pacifier (require 'viper-init) +(require 'viper-keym) ;; better be defined before Viper custom group. (defvar viper-custom-file-name (convert-standard-filename "~/.viper") @@ -691,6 +692,12 @@ remains buffer-local." (setq viper-mode nil) + (when (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists)) + (setq emulation-mode-map-alists + (delq 'viper--intercept-key-maps + (delq 'viper--key-maps emulation-mode-map-alists)) + )) + (viper-delocalize-var 'viper-vi-minibuffer-minor-mode) (viper-delocalize-var 'viper-insert-minibuffer-minor-mode) (viper-delocalize-var 'viper-vi-intercept-minor-mode) @@ -874,9 +881,27 @@ remains buffer-local." "Switch to emacs state while reading password." (viper-change-state-to-emacs))) + (defadvice self-insert-command (around viper-self-insert-ad activate) + "Ignore all self-inserting keys in the vi-state." + (if (and (eq viper-current-state 'vi-state) (interactive-p)) + (beep 1) + ad-do-it + )) + + (when (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists)) + ;; needs to be as early as possible + (add-to-ordered-list + 'emulation-mode-map-alists 'viper--intercept-key-maps 100) + ;; needs to be after cua-mode + (add-to-ordered-list 'emulation-mode-map-alists 'viper--key-maps 500) + ) + ;; Emacs shell, ange-ftp, and comint-based modes (add-hook 'comint-mode-hook 'viper-comint-mode-hook) ; comint + (add-hook 'eshell-mode-hook + (lambda () (setq viper-auto-indent nil))) + (viper-set-emacs-state-searchstyle-macros nil 'dired-mode) ; dired (viper-set-emacs-state-searchstyle-macros nil 'tar-mode) ; tar (viper-set-emacs-state-searchstyle-macros nil 'mh-folder-mode) ; mhe @@ -1058,6 +1083,14 @@ remains buffer-local." (define-key viper-insert-intercept-map "\C-x)" nil) (define-key viper-emacs-intercept-map "\C-x)" nil)) + (defadvice add-minor-mode (after + viper-advice-add-minor-mode + (toggle name &optional keymap after toggle-fun) + activate) + "Run viper-normalize-minor-mode-map-alist after adding a minor mode." + (viper-normalize-minor-mode-map-alist) + (setq-default minor-mode-map-alist minor-mode-map-alist)) + ;; catch frame switching event (if (viper-window-display-p) (if viper-xemacs-p -- cgit v1.2.1