emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emulation/viper.el


From: Michael Kifer
Subject: [Emacs-diffs] Changes to emacs/lisp/emulation/viper.el
Date: Sat, 06 Aug 2005 12:58:57 -0400

Index: emacs/lisp/emulation/viper.el
diff -c emacs/lisp/emulation/viper.el:1.82 emacs/lisp/emulation/viper.el:1.83
*** emacs/lisp/emulation/viper.el:1.82  Mon Aug  1 14:51:28 2005
--- emacs/lisp/emulation/viper.el       Sat Aug  6 16:58:54 2005
***************
*** 372,378 ****
  (defcustom viper-vi-state-mode-list
    '(fundamental-mode
      makefile-mode
-     help-mode
  
      awk-mode
      m4-mode
--- 372,377 ----
***************
*** 398,404 ****
      tex-mode latex-mode bibtex-mode
      ps-mode
  
!     completion-list-mode
      diff-mode
      idl-mode
  
--- 397,403 ----
      tex-mode latex-mode bibtex-mode
      ps-mode
  
!     ;; completion-list-mode
      diff-mode
      idl-mode
  
***************
*** 433,438 ****
--- 432,440 ----
      gnus-group-mode
      gnus-summary-mode
  
+     completion-list-mode
+     help-mode
+ 
      Info-mode
      Buffer-menu-mode
      compilation-mode
***************
*** 523,529 ****
  
  ;;;###autoload
  (defun viper-mode ()
!   "Turn on Viper emulation of Vi."
    (interactive)
    (if (not noninteractive)
        (progn
--- 525,531 ----
  
  ;;;###autoload
  (defun viper-mode ()
!   "Turn on Viper emulation of Vi in Emacs. See Info node `(viper)Viper'."
    (interactive)
    (if (not noninteractive)
        (progn
***************
*** 656,663 ****
  user customization, unrelated to Viper.  For instance, if the user advised
  `read-file-name', `describe-key', and some others, then this advice will be
  undone.
! It also doesn't undo some Viper settings.  For instance, 
`minor-mode-map-alist'
! remains buffer-local."
    (interactive)
  
    ;; restore non-viper vars
--- 658,664 ----
  user customization, unrelated to Viper.  For instance, if the user advised
  `read-file-name', `describe-key', and some others, then this advice will be
  undone.
! It also can't undo some Viper settings."
    (interactive)
  
    ;; restore non-viper vars
***************
*** 683,689 ****
        'mark-even-if-inactive viper-saved-non-viper-variables)))
  
    ;; Ideally, we would like to be able to de-localize local variables
!   (viper-delocalize-var 'minor-mode-map-alist)
    (viper-delocalize-var 'require-final-newline)
    (if viper-xemacs-p (viper-delocalize-var 'bar-cursor))
  
--- 684,692 ----
        'mark-even-if-inactive viper-saved-non-viper-variables)))
  
    ;; Ideally, we would like to be able to de-localize local variables
!   (unless
!       (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
!     (viper-delocalize-var 'minor-mode-map-alist))
    (viper-delocalize-var 'require-final-newline)
    (if viper-xemacs-p (viper-delocalize-var 'bar-cursor))
  
***************
*** 889,894 ****
--- 892,905 ----
        ad-do-it
        ))
  
+   (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))))
+     )
+ 
    (when (and (fboundp 'add-to-ordered-list) (boundp 
'emulation-mode-map-alists))
      ;; needs to be as early as possible
      (add-to-ordered-list
***************
*** 993,999 ****
    ;; viper-vi-local-user-map, viper-insert-local-user-map, and others can have
    ;; different keymaps for different buffers.  Also, the keymaps associated
    ;; with viper-vi/insert-state-modifier-minor-mode can be different.
!   (make-variable-buffer-local 'minor-mode-map-alist)
  
    ;; Viper changes the default mode-line-buffer-identification
    (setq-default mode-line-buffer-identification '(" %b"))
--- 1004,1013 ----
    ;; viper-vi-local-user-map, viper-insert-local-user-map, and others can have
    ;; different keymaps for different buffers.  Also, the keymaps associated
    ;; with viper-vi/insert-state-modifier-minor-mode can be different.
!   ;; ***This is needed only in case emulation-mode-map-alists is not defined
!   (unless
!       (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
!     (make-variable-buffer-local 'minor-mode-map-alist))
  
    ;; Viper changes the default mode-line-buffer-identification
    (setq-default mode-line-buffer-identification '(" %b"))
***************
*** 1088,1096 ****
                             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)
--- 1102,1112 ----
                             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)
!     (unless
!       (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
!       (setq-default minor-mode-map-alist minor-mode-map-alist)))
  
    ;; catch frame switching event
    (if (viper-window-display-p)
***************
*** 1264,1274 ****
  (define-key
    viper-emacs-intercept-map viper-toggle-key 'viper-change-state-to-vi)
  
  ;;; Escape from Emacs and Insert modes to Vi for one command
! (define-key
!   viper-emacs-intercept-map "\C-c\\" 'viper-escape-to-vi)
! (define-key
!   viper-insert-intercept-map "\C-c\\" 'viper-escape-to-vi)
  
  (if viper-mode
      (setq-default viper-emacs-intercept-minor-mode t
--- 1280,1289 ----
  (define-key
    viper-emacs-intercept-map viper-toggle-key 'viper-change-state-to-vi)
  
+ ;;; Removed to avoid bad interaction with cua-mode.
  ;;; Escape from Emacs and Insert modes to Vi for one command
! ;;(define-key viper-emacs-intercept-map "\C-c\\" 'viper-escape-to-vi)
! ;;(define-key viper-insert-intercept-map "\C-c\\" 'viper-escape-to-vi)
  
  (if viper-mode
      (setq-default viper-emacs-intercept-minor-mode t
***************
*** 1296,1302 ****
  (if (and viper-mode (eq viper-current-state 'emacs-state))
      (progn
        (viper-change-state-to-emacs)
!       (setq-default minor-mode-map-alist minor-mode-map-alist)
        ))
  
  (if (and viper-mode (this-major-mode-requires-vi-state major-mode))
--- 1311,1320 ----
  (if (and viper-mode (eq viper-current-state 'emacs-state))
      (progn
        (viper-change-state-to-emacs)
!       (unless
!         (and (fboundp 'add-to-ordered-list)
!              (boundp 'emulation-mode-map-alists))
!       (setq-default minor-mode-map-alist minor-mode-map-alist))
        ))
  
  (if (and viper-mode (this-major-mode-requires-vi-state major-mode))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]