Mercurial > emacs
comparison lisp/emulation/viper.el @ 91010:aaccdab0ee26
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 852-856)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 93-96)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 245)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-249
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 21 Aug 2007 04:54:03 +0000 |
parents | f55f9811f5d7 ff85cbd27ee2 |
children | bdb3fe0ba9fa |
comparison
equal
deleted
inserted
replaced
91009:e7395a700642 | 91010:aaccdab0ee26 |
---|---|
7 ;; 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | 7 ;; 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. |
8 | 8 |
9 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> | 9 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> |
10 ;; Keywords: emulations | 10 ;; Keywords: emulations |
11 | 11 |
12 (defconst viper-version "3.14 of June 14, 2007" | 12 (defconst viper-version "3.14 of August 18, 2007" |
13 "The current version of Viper") | 13 "The current version of Viper") |
14 | 14 |
15 ;; This file is part of GNU Emacs. | 15 ;; This file is part of GNU Emacs. |
16 | 16 |
17 ;; GNU Emacs is free software; you can redistribute it and/or modify | 17 ;; GNU Emacs is free software; you can redistribute it and/or modify |
644 ((string-match "-hook" (symbol-name symbol)) | 644 ((string-match "-hook" (symbol-name symbol)) |
645 (remove-hook symbol 'viper-mode) | 645 (remove-hook symbol 'viper-mode) |
646 (remove-hook symbol 'viper-change-state-to-emacs) | 646 (remove-hook symbol 'viper-change-state-to-emacs) |
647 (remove-hook symbol 'viper-change-state-to-insert) | 647 (remove-hook symbol 'viper-change-state-to-insert) |
648 (remove-hook symbol 'viper-change-state-to-vi) | 648 (remove-hook symbol 'viper-change-state-to-vi) |
649 (remove-hook symbol 'viper-minibuffer-post-command-hook) | |
650 (remove-hook symbol 'viper-minibuffer-setup-sentinel) | |
651 (remove-hook symbol 'viper-major-mode-change-sentinel) | |
652 (remove-hook symbol 'set-viper-state-in-major-mode) | |
653 (remove-hook symbol 'viper-post-command-sentinel) | |
649 ))) | 654 ))) |
650 | 655 |
651 ;; Remove local value in all existing buffers | 656 ;; Remove local value in all existing buffers |
652 ;; This doesn't delocalize vars (which would have been desirable) | 657 ;; This doesn't delocalize vars (which would have been desirable) |
653 (defun viper-delocalize-var (symbol) | 658 (defun viper-delocalize-var (symbol) |
680 (viper-standard-value | 685 (viper-standard-value |
681 'mode-line-buffer-identification viper-saved-non-viper-variables) | 686 'mode-line-buffer-identification viper-saved-non-viper-variables) |
682 global-mode-string | 687 global-mode-string |
683 (delq 'viper-mode-string global-mode-string)) | 688 (delq 'viper-mode-string global-mode-string)) |
684 | 689 |
690 (setq default-major-mode | |
691 (viper-standard-value 'default-major-mode viper-saved-non-viper-variables)) | |
692 | |
685 (if viper-emacs-p | 693 (if viper-emacs-p |
686 (setq-default | 694 (setq-default |
687 mark-even-if-inactive | 695 mark-even-if-inactive |
688 (viper-standard-value | 696 (viper-standard-value |
689 'mark-even-if-inactive viper-saved-non-viper-variables))) | 697 'mark-even-if-inactive viper-saved-non-viper-variables))) |
770 | 778 |
771 ;; remove all hooks set by viper | 779 ;; remove all hooks set by viper |
772 (mapatoms 'viper-remove-hooks) | 780 (mapatoms 'viper-remove-hooks) |
773 (remove-hook 'comint-mode-hook 'viper-comint-mode-hook) | 781 (remove-hook 'comint-mode-hook 'viper-comint-mode-hook) |
774 (remove-hook 'erc-mode-hook 'viper-comint-mode-hook) | 782 (remove-hook 'erc-mode-hook 'viper-comint-mode-hook) |
775 (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel) | |
776 (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel) | 783 (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel) |
777 (remove-hook 'post-command-hook 'viper-minibuffer-post-command-hook) | |
778 | 784 |
779 ;; unbind Viper mouse bindings | 785 ;; unbind Viper mouse bindings |
780 (viper-unbind-mouse-search-key) | 786 (viper-unbind-mouse-search-key) |
781 (viper-unbind-mouse-insert-key) | 787 (viper-unbind-mouse-insert-key) |
782 ;; In emacs, we have to advice handle-switch-frame | 788 ;; In emacs, we have to advice handle-switch-frame |
1212 | 1218 |
1213 ;; save non-viper vars that Viper might change | 1219 ;; save non-viper vars that Viper might change |
1214 (if (null viper-saved-non-viper-variables) | 1220 (if (null viper-saved-non-viper-variables) |
1215 (setq viper-saved-non-viper-variables | 1221 (setq viper-saved-non-viper-variables |
1216 (list | 1222 (list |
1223 (cons 'default-major-mode (list default-major-mode)) | |
1217 (cons 'next-line-add-newlines (list next-line-add-newlines)) | 1224 (cons 'next-line-add-newlines (list next-line-add-newlines)) |
1218 (cons 'require-final-newline (list require-final-newline)) | 1225 (cons 'require-final-newline (list require-final-newline)) |
1219 (cons 'scroll-step (list scroll-step)) | 1226 (cons 'scroll-step (list scroll-step)) |
1220 (cons 'mode-line-buffer-identification | 1227 (cons 'mode-line-buffer-identification |
1221 (list (default-value 'mode-line-buffer-identification))) | 1228 (list (default-value 'mode-line-buffer-identification))) |