diff options
author | Michael Kifer <kifer@cs.stonybrook.edu> | 2005-07-10 18:46:24 +0000 |
---|---|---|
committer | Michael Kifer <kifer@cs.stonybrook.edu> | 2005-07-10 18:46:24 +0000 |
commit | 8ea74b0e4570fe6e3ee583b0655bf6137d82dc28 (patch) | |
tree | d1d6a6c3acdc71b8843ee590b05c4e4150567803 /lisp/emulation/viper-cmd.el | |
parent | 9a4183e9ea0b4b2d09629652ce3d2d02bff1e647 (diff) | |
download | emacs-8ea74b0e4570fe6e3ee583b0655bf6137d82dc28.tar.gz |
* 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.
Diffstat (limited to 'lisp/emulation/viper-cmd.el')
-rw-r--r-- | lisp/emulation/viper-cmd.el | 72 |
1 files changed, 43 insertions, 29 deletions
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 4f247f2cd38..ecd5251891c 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -36,6 +36,8 @@ (defvar viper-always) (defvar viper-mode-string) (defvar viper-custom-file-name) +(defvar viper--key-maps) +(defvar viper--intercept-key-maps) (defvar iso-accents-mode) (defvar quail-mode) (defvar quail-current-str) @@ -92,7 +94,7 @@ ;; Variables for defining VI commands ;; Modifying commands that can be prefixes to movement commands -(defconst viper-prefix-commands '(?c ?d ?y ?! ?= ?# ?< ?> ?\")) +(defvar viper-prefix-commands '(?c ?d ?y ?! ?= ?# ?< ?> ?\")) ;; define viper-prefix-command-p (viper-test-com-defun viper-prefix-command) @@ -440,23 +442,24 @@ ;; This ensures that Viper bindings are in effect, regardless of which minor ;; modes were turned on by the user or by other packages. (defun viper-normalize-minor-mode-map-alist () - (setq minor-mode-map-alist - (viper-append-filter-alist - (list (cons 'viper-vi-intercept-minor-mode viper-vi-intercept-map) - (cons 'viper-vi-minibuffer-minor-mode viper-minibuffer-map) - (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map) - (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map) - (cons 'viper-vi-global-user-minor-mode viper-vi-global-user-map) - (cons 'viper-vi-state-modifier-minor-mode - (if (keymapp - (cdr (assoc major-mode - viper-vi-state-modifier-alist))) - (cdr (assoc major-mode viper-vi-state-modifier-alist)) - viper-empty-keymap)) - (cons 'viper-vi-diehard-minor-mode viper-vi-diehard-map) - (cons 'viper-vi-basic-minor-mode viper-vi-basic-map) - (cons 'viper-insert-intercept-minor-mode - viper-insert-intercept-map) + (setq viper--intercept-key-maps + (list + (cons 'viper-vi-intercept-minor-mode viper-vi-intercept-map) + (cons 'viper-insert-intercept-minor-mode viper-insert-intercept-map) + (cons 'viper-emacs-intercept-minor-mode viper-emacs-intercept-map) + )) + (setq viper--key-maps + (list (cons 'viper-vi-minibuffer-minor-mode viper-minibuffer-map) + (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map) + (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map) + (cons 'viper-vi-global-user-minor-mode viper-vi-global-user-map) + (cons 'viper-vi-state-modifier-minor-mode + (if (keymapp + (cdr (assoc major-mode viper-vi-state-modifier-alist))) + (cdr (assoc major-mode viper-vi-state-modifier-alist)) + viper-empty-keymap)) + (cons 'viper-vi-diehard-minor-mode viper-vi-diehard-map) + (cons 'viper-vi-basic-minor-mode viper-vi-basic-map) (cons 'viper-replace-minor-mode viper-replace-map) ;; viper-insert-minibuffer-minor-mode must come after ;; viper-replace-minor-mode @@ -476,8 +479,6 @@ viper-empty-keymap)) (cons 'viper-insert-diehard-minor-mode viper-insert-diehard-map) (cons 'viper-insert-basic-minor-mode viper-insert-basic-map) - (cons 'viper-emacs-intercept-minor-mode - viper-emacs-intercept-map) (cons 'viper-emacs-local-user-minor-mode viper-emacs-local-user-map) (cons 'viper-emacs-kbd-minor-mode viper-emacs-kbd-map) @@ -490,8 +491,16 @@ (cdr (assoc major-mode viper-emacs-state-modifier-alist)) viper-empty-keymap)) - ) - minor-mode-map-alist))) + )) + + ;; in emacs with emulation-mode-map-alists, nothing needs to be done + (unless + (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists)) + (setq minor-mode-map-alist + (viper-append-filter-alist + (append viper--intercept-key-maps viper--key-maps) + minor-mode-map-alist))) + ) @@ -1021,7 +1030,7 @@ as a Meta key and any number of multiple escapes is allowed." (not viper-translate-all-ESC-keysequences)) ;; put keys following ESC on the unread list ;; and return ESC as the key-sequence - (viper-set-unread-command-events (subseq keyseq 1)) + (viper-set-unread-command-events (viper-subseq keyseq 1)) (setq last-input-event event keyseq (if viper-emacs-p "\e" @@ -1032,7 +1041,7 @@ as a Meta key and any number of multiple escapes is allowed." (viper-set-unread-command-events (vconcat (vector (character-to-event (event-key first-key))) - (subseq keyseq 1))) + (viper-subseq keyseq 1))) (setq last-input-event event keyseq (vector (character-to-event ?\e)))) ((eventp first-key) @@ -3732,7 +3741,8 @@ Null string will repeat previous search." (interactive "P") (let ((val (viper-P-val arg)) (com (viper-getcom arg)) - (old-str viper-s-string)) + (old-str viper-s-string) + debug-on-error) (setq viper-s-forward t) (viper-if-string "/") ;; this is not used at present, but may be used later @@ -3744,7 +3754,8 @@ Null string will repeat previous search." (if com (progn (viper-move-marker-locally 'viper-com-point (mark t)) - (viper-execute-com 'viper-search-next val com))))) + (viper-execute-com 'viper-search-next val com))) + )) (defun viper-search-backward (arg) "Search a string backward. @@ -3753,7 +3764,8 @@ Null string will repeat previous search." (interactive "P") (let ((val (viper-P-val arg)) (com (viper-getcom arg)) - (old-str viper-s-string)) + (old-str viper-s-string) + debug-on-error) (setq viper-s-forward nil) (viper-if-string "?") ;; this is not used at present, but may be used later @@ -3858,7 +3870,8 @@ Null string will repeat previous search." "Repeat previous search." (interactive "P") (let ((val (viper-p-val arg)) - (com (viper-getcom arg))) + (com (viper-getcom arg)) + debug-on-error) (if (null viper-s-string) (error viper-NoPrevSearch)) (viper-search viper-s-string viper-s-forward arg) (if com @@ -3870,7 +3883,8 @@ Null string will repeat previous search." "Repeat previous search in the reverse direction." (interactive "P") (let ((val (viper-p-val arg)) - (com (viper-getcom arg))) + (com (viper-getcom arg)) + debug-on-error) (if (null viper-s-string) (error viper-NoPrevSearch)) (viper-search viper-s-string (not viper-s-forward) arg) (if com |