summaryrefslogtreecommitdiff
path: root/lisp/emulation/viper.el
diff options
context:
space:
mode:
authorMichael Kifer <kifer@cs.stonybrook.edu>2006-08-25 16:06:57 +0000
committerMichael Kifer <kifer@cs.stonybrook.edu>2006-08-25 16:06:57 +0000
commit83f49acbc0d4062538c350564266813d0254bc5d (patch)
tree82aa1427598dfb738589d07709fc6e4d09c0e422 /lisp/emulation/viper.el
parent966949b00f0515e586645cee56d42a14dac4f9fc (diff)
downloademacs-83f49acbc0d4062538c350564266813d0254bc5d.tar.gz
2006-08-25 Michael Kifer <kifer@cs.stonybrook.edu>
* viper.el (viper-set-hooks): use frame bindings for viper-vi-state-cursor-color. (viper-non-hook-settings): don't set default mode-line-buffer-identification. * viper-util.el (viper-set-cursor-color-according-to-state): new function. (viper-set-cursor-color-according-to-state, viper-get-saved-cursor-color-in-replace-mode, viper-get-saved-cursor-color-in-insert-mode): make conditional on viper-emacs-state-cursor-color. * viper-cmd.el (viper-envelop-ESC-key): bug fix. (viper-undo): use point if undo-beg-posn is nil. (viper-insert-state-post-command-sentinel,viper-change-state-to-emacs, viper-after-change-undo-hook): don't use viper-emacs-state-cursor-color by default. (viper-undo): more sensible positioning after undo. * viper-ex.el (ex-splice-args-in-1-letr-cmd): got rid of caddr. (viper-emacs-state-cursor-color): default to nil, since this feature doesn't work well yet. * ediff-mult.el (ediff-intersect-directories, ediff-get-directory-files-under-revision, ediff-dir-diff-copy-file): always expand filenames.
Diffstat (limited to 'lisp/emulation/viper.el')
-rw-r--r--lisp/emulation/viper.el19
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 8f858526da3..0ba7bdd041a 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -534,10 +534,6 @@ If Viper is enabled, turn it off. Otherwise, turn it on."
(defun viper-mode ()
"Turn on Viper emulation of Vi in Emacs. See Info node `(viper)Viper'."
(interactive)
- (if (null viper-vi-state-cursor-color)
- (modify-frame-parameters
- (selected-frame)
- (list (cons 'viper-vi-state-cursor-color (viper-get-cursor-color)))))
(if (not noninteractive)
(progn
;; if the user requested viper-mode explicitly
@@ -618,7 +614,8 @@ This startup message appears whenever you load Viper, unless you type `y' now."
(or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi
(memq major-mode viper-insert-state-mode-list) ; don't switch
- (viper-change-state-to-vi)))))
+ (viper-change-state-to-vi))
+ )))
;; Apply a little heuristic to invoke vi state on major-modes
@@ -862,8 +859,11 @@ It also can't undo some Viper settings."
;; info about the display and windows until emacs initialization is complete
;; So do it via the window-setup-hook
(add-hook 'window-setup-hook
- '(lambda ()
- (setq viper-vi-state-cursor-color (viper-get-cursor-color))))
+ '(lambda ()
+ (modify-frame-parameters
+ (selected-frame)
+ (list (cons 'viper-vi-state-cursor-color
+ (viper-get-cursor-color))))))
;; Tell vc-diff to put *vc* in Vi mode
(if (featurep 'vc)
@@ -903,7 +903,6 @@ It also can't undo some Viper settings."
(defadvice set-cursor-color (after viper-set-cursor-color-ad activate)
"Change cursor color in VI state."
- ;;(setq viper-vi-state-cursor-color (ad-get-arg 0))
(modify-frame-parameters
(selected-frame)
(list (cons 'viper-vi-state-cursor-color (ad-get-arg 0))))
@@ -1008,8 +1007,8 @@ It also can't undo some Viper settings."
;; these are primarily advices and Vi-ish variable settings
(defun viper-non-hook-settings ()
- ;; Viper changes the default mode-line-buffer-identification
- (setq-default mode-line-buffer-identification '(" %b"))
+ ;;;; Viper changes the default mode-line-buffer-identification
+ ;;(setq-default mode-line-buffer-identification '(" %b"))
;; setup emacs-supported vi-style feel
(setq next-line-add-newlines nil